sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit fd1bc5f6cbb8ed3c2ba351229d32d292a2ab2a03
parent ad24773716bb3b35e4b5a65e90b50bdf05d4f190
Author: FRIGN <dev@frign.de>
Date:   Tue Sep 29 23:14:59 +0200

Check explicit length in od(1)

If you pass an empty string, the null-char will always match
with strchr()!

Diffstat:
od.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/od.c b/od.c @@ -108,13 +108,13 @@ main(int argc, char *argv[]) ARGBEGIN { case 'A': s = EARGF(usage()); - if (strlen(s) > 1 || !strchr("doxn", s[0])) + if (strlen(s) != 1 || !strchr("doxn", s[0])) usage(); radix = s[0]; break; case 't': s = EARGF(usage()); - if (strlen(s) > 1 || !strchr("acdoux", s[0])) + if (strlen(s) != 1 || !strchr("acdoux", s[0])) usage(); type = s[0]; break;