summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-22 14:37:16 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2009-11-22 14:37:16 (GMT)
commit11f3a8b7ed366b23e4740fc847662a971cf65de3 (patch)
treee5b28d46626a2097429a076cd1d30aa29b0c9ae9
parentb1585064fdac138b3bd14c2b64f64c67ec08b654 (diff)
downloadbusybox-11f3a8b7ed366b23e4740fc847662a971cf65de3.tar.gz
busybox-11f3a8b7ed366b23e4740fc847662a971cf65de3.tar.bz2
od: fix -tx without length spec
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/od_bloaty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index 0c4740b..6a532fa 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -545,7 +545,8 @@ decode_one_format(const char *s_orig, const char *s, struct tspec *tspec)
c = *s++;
p = strchr(CSIL, *s);
- if (!p) {
+ /* if *s == NUL, p != NULL! Testcase: "od -tx" */
+ if (!p || *p == '\0') {
size = sizeof(int);
if (isdigit(s[0])) {
size = bb_strtou(s, &end, 0);