diff options
author | eadler <eadler@FreeBSD.org> | 2012-12-18 21:02:38 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2012-12-18 21:02:38 +0000 |
commit | 0c8af40857c82fc7e7b484dcd6d85076583109ea (patch) | |
tree | 9ecfe92a175b4198b319072ba6b3848aaeb69e2c /usr.bin | |
parent | fcd944ca59586f9936bdb0c0bb82712869544a37 (diff) | |
download | FreeBSD-src-0c8af40857c82fc7e7b484dcd6d85076583109ea.zip FreeBSD-src-0c8af40857c82fc7e7b484dcd6d85076583109ea.tar.gz |
POSIX requires that non-existent or null arguments be treated as if a
zero argument were supplied.
Add a regression test to catch this case as well.
PR: bin/174521
Submitted by: Daniel Shahaf <danielsh@elego.de> (pr)
Submitted by: Mark Johnston <markjdb@gmail.com> (initial patch)
Reviewed by: jilles
Approved by: cperciva (implicit)
MFC after: 3 weeks
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/printf/printf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 4b09342..2368f184 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -473,7 +473,7 @@ getnum(intmax_t *ip, uintmax_t *uip, int signedconv) int rval; if (!*gargv) { - *ip = 0; + *ip = *uip = 0; return (0); } if (**gargv == '"' || **gargv == '\'') { |