Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#15,592 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

Inizia in src/uu/od/src/od.rs, in extract_strings_from_input, dove l’issue indica il formato dell’offset della stringa, quindi confrontalo con InputOffset::format_byte_offset in input_offset.rs. Riproduci il problema con printf 'a\0' | od -Ax -S1; il lavoro è completato quando l’output delle stringhe usa sei cifre esadecimali e corrisponde al dump normale e al comportamento di GNU od.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Rust
Stelle
24.3k
Fork
2.1k
Merge medio
2g 28m
PR unite (30g)
313

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uutils/coreutils

Tutte le issue di uutils/coreutils

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.