1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-12-24 22:59:49 +05:30

reverse-ramdisk.c: correct snprintf call

This commit is contained in:
Intel A80486DX2-66 2023-12-28 00:04:22 +03:00
parent f6a8c9025e
commit be048aa266
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -67,7 +67,7 @@ int tf_alloc(size_t n, size_t type_size) {
line_fail(-2);
return -1;
}
int res = snprintf(file_path, file_path_len, "tf_%" PRIuMAX ".tmp",
int res = snprintf(file_path, file_path_len + 1, "tf_%" PRIuMAX ".tmp",
(uintmax_t) num_temp_files);
if ((size_t) res != file_path_len) {
line_fail(-2);