summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-10-28 14:38:55 +0000
committerchristos <christos@NetBSD.org>2006-10-28 14:38:55 +0000
commitf71e448c3b5ac35cb01a7d5be0ef60c835ca07e5 (patch)
treea9939c5b4cfef2e6a4ea049373e4175e0f6da314 /lib/libc/stdio/vfprintf.c
parent08c311c029d7b5f21ca8e8009461552bdc6accd2 (diff)
initialize floating_point as needed.
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index d37d3b03277..9537f56056f 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vfprintf.c,v 1.51 2006/10/27 19:59:58 christos Exp $ */
+/* $NetBSD: vfprintf.c,v 1.52 2006/10/28 14:38:55 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -37,7 +37,7 @@
#if 0
static char *sccsid = "@(#)vfprintf.c 5.50 (Berkeley) 12/16/92";
#else
-__RCSID("$NetBSD: vfprintf.c,v 1.51 2006/10/27 19:59:58 christos Exp $");
+__RCSID("$NetBSD: vfprintf.c,v 1.52 2006/10/28 14:38:55 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -214,7 +214,7 @@ __vfprintf_unlocked(fp, fmt0, ap)
wchar_t wc;
mbstate_t ps;
#ifndef NO_FLOATING_POINT
- char *decimal_point = localeconv()->decimal_point;
+ char *decimal_point;
char softsign; /* temporary negative sign for floats */
double _double; /* double precision arguments %[eEfgG] */
int expt; /* integer value of exponent */
@@ -747,6 +747,9 @@ number: if ((dprec = prec) >= 0)
PRINT(cp, size);
} else { /* glue together f_p fragments */
if (ch >= 'f') { /* 'f' or 'g' */
+ if (decimal_point == NULL)
+ decimal_point =
+ localeconv()->decimal_point;
if (_double == 0) {
/* kludge for __dtoa irregularity */
PRINT("0", 1);