diff --git a/c-programming/reverse-ramdisk.c b/c-programming/reverse-ramdisk.c index 825e7f1..f36e5ea 100644 --- a/c-programming/reverse-ramdisk.c +++ b/c-programming/reverse-ramdisk.c @@ -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);