Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

od: `-S` with `-Ax` prints 7-digit hex offsets instead of 6

Closed Beginner friendly
#15,592 0 comments 0 reactions 0 assignees View on GitHub

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
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

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

U - od

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

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/coreutils

All issues in uutils/coreutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.