Skip to content

[Repo Assist] feat: add %o octal format and # flag to l_vsnprintf#138

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/feat-snprintf-octal-hash-2026-04-19-e43284a-7959303f2f811899
Draft

[Repo Assist] feat: add %o octal format and # flag to l_vsnprintf#138
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/feat-snprintf-octal-hash-2026-04-19-e43284a-7959303f2f811899

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist.

Summary

Add two missing format features to l_vsnprintf:

  • %o / %lo / %llo: octal integer formatting
  • # flag for %x/%X (adds 0x/0X prefix for nonzero values)
  • # flag for %o (adds 0 prefix for nonzero values)

These are required by POSIX/C99 printf conformance and are commonly used for file permission display (%04o) and hex dumps.

Changes

  • l_os.h: adds flag_hash to the flag-parsing loop, adds %o to the numeric dispatcher, extends the prefix logic for #x, #X, #o
  • tests/test_strings.c: 5 new test cases covering basic octal, zero, permissions, zero-pad, and # flag

Test Status

✅ Linux/gcc: build PASS, 1515 assertions PASS
✅ Linux/clang: build PASS, 1513 assertions PASS
✅ Verify: 52 binaries, max 117KB, static PASS

Generated by 🌈 Repo Assist at {run-started}. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@1f672aef974f4246124860fc532f82fe8a93a57e

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants