diff options
| author | ShengYi Hung <aokblast@FreeBSD.org> | 2026-07-07 04:49:48 +0000 |
|---|---|---|
| committer | ShengYi Hung <aokblast@FreeBSD.org> | 2026-07-20 08:11:54 +0000 |
| commit | b8f1972d51cf93ba4393d621b126dbd408423b87 (patch) | |
| tree | 11f590537877292f45fbc593ab4249750b2d75bc | |
| parent | 7fc2c9f688efb12beddd58a01628157e32b632b0 (diff) | |
hexdump: Support octal and hex for -N option
GNU hexdump supports octal and hex, we add supports for BSD style
hexdump for better compatibility.
See: https://github.com/llvm/llvm-project/pull/206581/
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58074
| -rw-r--r-- | usr.bin/hexdump/odsyntax.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/hexdump/odsyntax.c b/usr.bin/hexdump/odsyntax.c index 6c7ca55c3232..62d427a86e5d 100644 --- a/usr.bin/hexdump/odsyntax.c +++ b/usr.bin/hexdump/odsyntax.c @@ -139,7 +139,7 @@ oldsyntax(int argc, char ***argvp) errx(1, "%s: invalid skip amount", optarg); break; case 'N': - if ((length = atoi(optarg)) <= 0) + if ((length = strtol(optarg, NULL, 0)) <= 0) errx(1, "%s: invalid length", optarg); break; case 'O': |
