When FDB_USING_FILE_LIBC_MODE is enabled, the libc functions fwrite and fread awaited an incorrect return.
Current function calls want to write size bytes once, and wait for the size of bytes written to be returned, but the functions return how many times the size was written (written as 1 in the code), which always returns 1, if it succeeds.
On success, fread() and fwrite() return the number of items read
or written. This number equals the number of bytes transferred
only when size is 1. If an error occurs, or the end of the file
is reached, the return value is a short item count (or zero).
When
FDB_USING_FILE_LIBC_MODE
is enabled, thelibc
functionsfwrite
andfread
awaited an incorrect return.Current function calls want to write
size
bytes once, and wait for the size of bytes written to be returned, but the functions return how many times thesize
was written (written as1
in the code), which always returns1
, if it succeeds.[source]