Skip to content

fbuffer: don't report failure for an empty write - #1210

Open
b84330808 wants to merge 1 commit into
msgpack:c_masterfrom
b84330808:fix-fbuffer-empty-write
Open

b84330808 wants to merge 1 commit into
msgpack:c_masterfrom
b84330808:fix-fbuffer-empty-write

Conversation

@b84330808

Copy link
Copy Markdown

fwrite() returns 0 when the size is 0, so msgpack_fbuffer_write() reported -1 for an empty buffer and msgpack_pack_str_body() failed on empty strings to a FILE*, even though nothing went wrong. Same fix as #1165 for the C++ fbuffer, with a test.

fwrite() returns 0 when the size is 0, so msgpack_fbuffer_write() reported
-1 for an empty buffer, and msgpack_pack_str_body() and msgpack_pack_object()
failed on empty strings even though nothing went wrong. The C++ fbuffer got
the same fix in msgpack#1165.

This branch has not been deployed

No deployments
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