summaryrefslogtreecommitdiffstats
path: root/usr.bin/printf/printf.c
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-04-13 19:54:03 +0000
committerstefanf <stefanf@FreeBSD.org>2005-04-13 19:54:03 +0000
commitfd79e6a683f5cdeccf9f8e28fa75f6ee8ed529ed (patch)
tree5ceb3543621e1922a9b5e78df2a5941ccee06ba9 /usr.bin/printf/printf.c
parent83f4612675523ec322bc3a2ee75be34da259c6e7 (diff)
downloadFreeBSD-src-fd79e6a683f5cdeccf9f8e28fa75f6ee8ed529ed.zip
FreeBSD-src-fd79e6a683f5cdeccf9f8e28fa75f6ee8ed529ed.tar.gz
Assign 0.0 to the variable passed to getfloating() if the argument is missing.
MFC after: 1 week
Diffstat (limited to 'usr.bin/printf/printf.c')
-rw-r--r--usr.bin/printf/printf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 64aa07a..dc15952 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);
OpenPOWER on IntegriCloud