From 0c8af40857c82fc7e7b484dcd6d85076583109ea Mon Sep 17 00:00:00 2001 From: eadler Date: Tue, 18 Dec 2012 21:02:38 +0000 Subject: 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 (pr) Submitted by: Mark Johnston (initial patch) Reviewed by: jilles Approved by: cperciva (implicit) MFC after: 3 weeks --- usr.bin/printf/printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin/printf') 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 == '\'') { -- cgit v1.1