Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug with reversed arguments to the fwrite and fread functions for libc file mode. #333

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MGlolenstine
Copy link

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).

[source]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant