From: Kevin Day Date: Sat, 31 Mar 2012 02:34:23 +0000 (-0500) Subject: Bugfix: checking for == on fwrite size results is not an error X-Git-Tag: 0.3.0~37 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=659017197bf006a5db00abf5247ea4eadae3230b;p=fll 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. --- diff --git a/level_1/fl_file/c/file.c b/level_1/fl_file/c/file.c index 222802c8b..8b923e5c0 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; }