Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/printf Always convert input numbers (from the comman...



details:   https://anonhg.NetBSD.org/src/rev/ad58091ad92a
branches:  trunk
changeset: 838631:ad58091ad92a
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Jan 26 15:22:54 2019 +0000

description:
Always convert input numbers (from the command line) in the C
locale, not as set in the environment.   Conforms with POSIX spec.

diffstat:

 usr.bin/printf/printf.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 26ebb9b95a3b -r ad58091ad92a usr.bin/printf/printf.c
--- a/usr.bin/printf/printf.c   Sat Jan 26 15:20:50 2019 +0000
+++ b/usr.bin/printf/printf.c   Sat Jan 26 15:22:54 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: printf.c,v 1.46 2018/09/10 14:42:29 kre Exp $  */
+/*     $NetBSD: printf.c,v 1.47 2019/01/26 15:22:54 kre Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)printf.c   8.2 (Berkeley) 3/22/95";
 #else
-__RCSID("$NetBSD: printf.c,v 1.46 2018/09/10 14:42:29 kre Exp $");
+__RCSID("$NetBSD: printf.c,v 1.47 2019/01/26 15:22:54 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -682,7 +682,7 @@
                return (double) *((*gargv++)+1);
 
        errno = 0;
-       val = strtod(*gargv, &ep);
+       val = strtod_l(*gargv, &ep, LC_C_LOCALE);
        check_conversion(*gargv++, ep);
        return val;
 }



Home | Main Index | Thread Index | Old Index