Module Name:    src
Committed By:   kre
Date:           Sat Jan 26 15:22:54 UTC 2019

Modified Files:
        src/usr.bin/printf: printf.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/printf/printf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/printf/printf.c
diff -u src/usr.bin/printf/printf.c:1.46 src/usr.bin/printf/printf.c:1.47
--- src/usr.bin/printf/printf.c:1.46	Mon Sep 10 14:42:29 2018
+++ src/usr.bin/printf/printf.c	Sat Jan 26 15:22:54 2019
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #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 @@ getdouble(void)
 		return (double) *((*gargv++)+1);
 
 	errno = 0;
-	val = strtod(*gargv, &ep);
+	val = strtod_l(*gargv, &ep, LC_C_LOCALE);
 	check_conversion(*gargv++, ep);
 	return val;
 }

Reply via email to