GNU bug report logs - #24874
dd: misleading parsing of hex numbers

Previous Next

Package: coreutils;

Reported by: Stephan Bauroth <der_steffi <at> gmx.de>

Date: Fri, 4 Nov 2016 15:40:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephan Bauroth <der_steffi <at> gmx.de>
To: bug-coreutils <at> gnu.org
Subject: dd: misleading parsing of hex numbers
Date: Fri, 4 Nov 2016 12:19:40 +0100
Dear coreutils team :)

I encountered a buglike behaviour of dd when handling skip and count 
parameters that are encoded in hex and thus prefixed with 0x.

dd is not able to parse them, which is OK but would be great if it would 
be, but, worse, reads 0xf00 as 0. It does that silently. While an 
enduser will immediately notice this on count, since nothing is copied, 
behaviour for skip looks ok. (In fact, I noticed this only because I 
hexdumped the result after hours of debugging)

While it's OK that dd can't parse these numbers, maybe there should be a 
warning that 0x was found and interpreted as 0. Since a char like 'x' is 
invalid within a number that by definition has to be decimal, a warning 
should be fairly easy to implement.

Of course, the ability to parse hex numbers in these parameters would be 
awesome :)

regards and thanks for your continuing work,
Stephan Bauroth




This bug report was last modified 8 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.