Skip to content

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

Merged
redboltz merged 1 commit into
msgpack:c_masterfrom
b84330808:fix-fbuffer-empty-write
Nov 16, 2026
Merged

redboltz merged 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.

@redboltz

Copy link
Copy Markdown
Contributor

Appveyor reported errors.
I've fixed appveyor environment. Could you rebase your PR ?

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.
@b84330808

Copy link
Copy Markdown
Author

Rebased onto c_master, thanks for fixing AppVeyor.

@b84330808
b84330808 force-pushed the fix-fbuffer-empty-write branch from 31849d8 to c8c925a Compare November 15, 2026 04:16
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.66%. Comparing base (eabfe29) to head (c8c925a).
⚠️ Report is 19 commits behind head on c_master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##           c_master    #1210      +/-   ##
============================================
+ Coverage     57.47%   62.66%   +5.18%     
============================================
  Files            10       10              
  Lines          1124     1149      +25     
  Branches        129      141      +12     
============================================
+ Hits            646      720      +74     
+ Misses          478      429      -49     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@redboltz

Copy link
Copy Markdown
Contributor

Thank you for updating.

@redboltz
redboltz merged commit 4d37150 into msgpack:c_master Nov 16, 2026
19 checks passed
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.

3 participants