od: `-S` with `-Ax` prints 7-digit hex offsets instead of 6
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #15625 by @ozenyunus35 — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Start in src/uu/od/src/od.rs at extract_strings_from_input, where the issue identifies the string offset format, then compare it with InputOffset::format_byte_offset in input_offset.rs. Reproduce with printf 'a\0' | od -Ax -S1; done when the strings output uses six hex digits and matches the normal dump and GNU od behavior.
Written by the indexing model from the issue text.
Description
With -S/--strings and -Ax, uutils od zero-pads string offsets to 7 hex digits. GNU od pads them to 6, and so does uutils od's own normal dump with -Ax. Decimal (-Ad) and octal (-Ao) offsets already use 7 digits in both.
The GNU manual does not spell out the width; it describes -A RADIX as selecting "the base in which file offsets are printed". GNU 9.12 uses 6 hex digits for every output mode, -S included.
printf 'a\0' | od -Ax -S1
# GNU 9.12: 000000 a
# uutils: 0000000 a
printf 'a\0' | od -Ax -c | head -1
# GNU 9.12: 000000 a \0
# uutils: 000000 a \0 (same uutils build, normal dump: 6 digits)
Versions. uutils main eee56033d28bf7ef5cc816286b048779d57fb803 (2026-10-21) and the 0.12.0 release binary, macOS 26 aarch64 (the loop found it on Linux x86_64), LC_ALL=C, compared with GNU coreutils 9.12.
Where. extract_strings_from_input in src/uu/od/src/od.rs formats the offset itself with {offset:07x}, while InputOffset::format_byte_offset (input_offset.rs) uses {:06x} for hex.
Related: #11613, #11744, #13396 (offset values with -S -N), not the width.
Found with an automated differential tester that compares uutils with GNU 9.12.
Reproduction steps
export LC_ALL=C
printf 'a\0' | od -Ax -S1
# GNU 9.12: 000000 a
# uutils: 0000000 a
- Dominant language
- Rust
- Stars
- 24.3k
- Forks
- 2.1k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 313
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/coreutils
-
U - sort
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
uutils/coreutils#15598 · 3 comments ·
Maintainers usually reply within 1 day
-
U - sort
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
uutils/coreutils#15596 · 3 comments ·
Maintainers usually reply within 1 day
-
U - sort
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
U - sort
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
nl: unnumbered lines are padded with width+1 spaces, ignoring the length of `-s`Possibly taken @cakebaker claimed this today. OpenU - nl
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
All issues in uutils/coreutils
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
area:sim good first issue kind:feature
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
The demo's interval button and chart legend keep the previous interval after an interval changeOpenbug ui
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
userFRM/egui-charts#670 ·
Maintainers usually reply within 1 day
-
docs good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Usenova-Labs/usenova-backend#35 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
lugassawan/swe-workbench#823 ·
Maintainers usually reply within 1 day