diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 64aa07a07505..dc159526fb25 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -495,8 +495,10 @@ getfloating(long double *dp, int mod_ldbl) char *ep; int rval; - if (!*gargv) + if (!*gargv) { + *dp = 0.0; return (0); + } if (**gargv == '"' || **gargv == '\'') { *dp = asciicode(); return (0);