From 659017197bf006a5db00abf5247ea4eadae3230b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 30 Mar 2012 21:34:23 -0500 Subject: [PATCH] Bugfix: checking for == on fwrite size results is not an error The code was checking the total number of bytes written and the total number expected to be written. If both numbers are the same, then this cannot be an error. --- level_1/fl_file/c/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/level_1/fl_file/c/file.c b/level_1/fl_file/c/file.c index 222802c..8b923e5 100644 --- a/level_1/fl_file/c/file.c +++ b/level_1/fl_file/c/file.c @@ -116,7 +116,7 @@ extern "C"{ size = fwrite(buffer.string, file.byte_size, buffer.used, file.file); - if (size <= buffer.used * file.byte_size) { + if (size < buffer.used * file.byte_size) { return f_file_write_error; } @@ -139,7 +139,7 @@ extern "C"{ size = fwrite(buffer.string + position.start, file.byte_size, total, file.file); - if (size <= total * file.byte_size) { + if (size < total * file.byte_size) { return f_file_write_error; } -- 1.8.3.1