You should write about such problems to the mailing list: [email protected]

On Tuesday 06 April 2010 15:32, David Parkinson wrote:
> Hi,
> 
> Apologies if the answer to this is somewhere obvious but neither I 
> nor Google have found it...
> 
> I've been using busybox as part of the tinycore distribution and find 
> it irritating that it apparently only accepts decimal numbers on the 
> command line.  In particular I've been using hexdump to look at 
> particular areas of memory.  e.g.
> 
>     hexdump -C -n 128 -s 0xC00000 /dev/mem
> 
> Works fine with the standard utility (eg in Fedora) but with busybox 
> I just get:
> 
> hexdump: invalid number '0xC00000'
> 
> I tried sticking an 'h' on the backend but that didn't help either.
> 
> Have I got the syntax wrong?  Is it busybox? Is it tinycore's implementation?

Please try attached patch.
-- 
vda
diff -ad -urpN busybox.7/util-linux/hexdump.c busybox.8/util-linux/hexdump.c
--- busybox.7/util-linux/hexdump.c	2010-04-03 00:52:00.000000000 +0200
+++ busybox.8/util-linux/hexdump.c	2010-04-06 23:28:42.000000000 +0200
@@ -92,8 +92,8 @@ int hexdump_main(int argc, char **argv)
 		if (ch == 'n') {
 			dumper->dump_length = xatoi_u(optarg);
 		} /* else */
-		if (ch == 's') {
-			dumper->dump_skip = xatoul_range_sfx(optarg, 0, LONG_MAX, suffixes);
+		if (ch == 's') { /* compat: -s accepts hex numbers too */
+			dumper->dump_skip = xstrtoul_range_sfx(optarg, /*base:*/ 0, /*lo:*/ 0, /*hi:*/ LONG_MAX, suffixes);
 		} /* else */
 		if (ch == 'v') {
 			dumper->dump_vflag = ALL;
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to