summaryrefslogtreecommitdiffstats
path: root/usr.bin/printf
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2004-03-07 22:22:13 +0000
committercperciva <cperciva@FreeBSD.org>2004-03-07 22:22:13 +0000
commit41b17057eff98a603cc4f9dea224f7081ca9fbb4 (patch)
treebb96883d9bb703d58d095462715b57f793895d57 /usr.bin/printf
parentf13324f65bc2419a9196c4eca76e5e57c0d7fea5 (diff)
downloadFreeBSD-src-41b17057eff98a603cc4f9dea224f7081ca9fbb4.zip
FreeBSD-src-41b17057eff98a603cc4f9dea224f7081ca9fbb4.tar.gz
Make it possible for the %[eEfgG] formats to not result in an error
being reported by /usr/bin/printf. This bug has been around for 22 months... either nobody uses printf with floating-point values, or people are forgetting to check their return codes. Approved by: rwatson (mentor)
Diffstat (limited to 'usr.bin/printf')
-rw-r--r--usr.bin/printf/printf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index cc32e4f..a99958e 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -473,7 +473,7 @@ getdouble(double *dp)
*dp = asciicode();
return (0);
}
- rval = 1;
+ rval = 0;
errno = 0;
*dp = strtod(*gargv, &ep);
if (ep == *gargv) {
OpenPOWER on IntegriCloud