From: Denys Vlasenko Date: Sun, 22 Nov 2009 14:37:16 +0000 (+0100) Subject: od: fix -tx without length spec X-Git-Tag: 1_16_0~213 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=11f3a8b7ed366b23e4740fc847662a971cf65de3;p=oweals%2Fbusybox.git od: fix -tx without length spec Signed-off-by: Denys Vlasenko --- diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 0c4740b47..6a532fa9d 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);