Skip to content

Fix bugs and cleanup in example code#401

Merged
PJK merged 1 commit into
masterfrom
fix-examples
Feb 8, 2026
Merged

Fix bugs and cleanup in example code#401
PJK merged 1 commit into
masterfrom
fix-examples

Conversation

@PJK

@PJK PJK commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bug: Fix scanf -> sscanf in streaming_array.c — the command-line argument was never actually parsed
  • Bug: Fix memory leak in cbor_sequence.c — missing cbor_move on cbor_array_push calls
  • Cleanup: Add missing #include <stdio.h> in streaming_array.c
  • Cleanup: Add missing #include <stdlib.h> in readfile.c and streaming_parser.c
  • Cleanup: Free json_buffer and close file handle in cjson2cbor.c
  • Cleanup: Add missing cbor_decref for array in sort.c

Test plan

  • All examples compile
  • All 26 tests pass

🤖 Generated with Claude Code

- Fix scanf -> sscanf in streaming_array.c (was never parsing argv)
- Add missing #include <stdio.h> in streaming_array.c
- Fix memory leak in cbor_sequence.c (missing cbor_move on array push)
- Add missing #include <stdlib.h> in readfile.c and streaming_parser.c
- Free json_buffer and close file in cjson2cbor.c
- Add missing cbor_decref in sort.c

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PJK
PJK merged commit 07e3fa4 into master Feb 8, 2026
15 of 16 checks passed
@PJK
PJK deleted the fix-examples branch February 8, 2026 19:50
@codecov

codecov Bot commented Feb 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d292333) to head (d2d09a8).
⚠️ Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #401   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines         1663      1663           
=========================================
  Hits          1663      1663           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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