]> Kevux Git Server - fll/commitdiff
Bugfix: checking for == on fwrite size results is not an error
authorKevin Day <kevin@kevux.org>
Sat, 31 Mar 2012 02:34:23 +0000 (21:34 -0500)
committerKevin Day <kevin@kevux.org>
Sat, 31 Mar 2012 02:34:23 +0000 (21:34 -0500)
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

index 222802c..8b923e5 100644 (file)
@@ -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;
     }