od: fix -tx without length spec

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2009-11-22 15:37:16 +01:00
parent b1585064fd
commit 11f3a8b7ed

View File

@ -545,7 +545,8 @@ decode_one_format(const char *s_orig, const char *s, struct tspec *tspec)
c = *s++; c = *s++;
p = strchr(CSIL, *s); p = strchr(CSIL, *s);
if (!p) { /* if *s == NUL, p != NULL! Testcase: "od -tx" */
if (!p || *p == '\0') {
size = sizeof(int); size = sizeof(int);
if (isdigit(s[0])) { if (isdigit(s[0])) {
size = bb_strtou(s, &end, 0); size = bb_strtou(s, &end, 0);