Module Name: src Committed By: bouyer Date: Sat Sep 5 11:40:11 UTC 2009
Modified Files: src/lib/libc/stdio [netbsd-5-0]: vfwprintf.c Log Message: Pull up following revision(s) (requested by dsl in ticket #902): lib/libc/stdio/vfwprintf.c: revision 1.16 If the current locale doesn't define the 'thousands' grouping info then use sane defaults (',' every 3 digits). Fixes PR/40714 To generate a diff of this commit: cvs rdiff -u -r1.13.4.1 -r1.13.4.1.2.1 src/lib/libc/stdio/vfwprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/stdio/vfwprintf.c diff -u src/lib/libc/stdio/vfwprintf.c:1.13.4.1 src/lib/libc/stdio/vfwprintf.c:1.13.4.1.2.1 --- src/lib/libc/stdio/vfwprintf.c:1.13.4.1 Wed Feb 25 03:24:14 2009 +++ src/lib/libc/stdio/vfwprintf.c Sat Sep 5 11:40:11 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vfwprintf.c,v 1.13.4.1 2009/02/25 03:24:14 snj Exp $ */ +/* $NetBSD: vfwprintf.c,v 1.13.4.1.2.1 2009/09/05 11:40:11 bouyer Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; __FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.27 2007/01/09 00:28:08 imp Exp $"); #else -__RCSID("$NetBSD: vfwprintf.c,v 1.13.4.1 2009/02/25 03:24:14 snj Exp $"); +__RCSID("$NetBSD: vfwprintf.c,v 1.13.4.1.2.1 2009/09/05 11:40:11 bouyer Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -897,6 +897,12 @@ flags |= GROUPING; thousands_sep = *(localeconv()->thousands_sep); grouping = localeconv()->grouping; + /* If the locale doesn't define the above, use sane + * defaults - otherwise silly things happen! */ + if (thousands_sep == 0) + thousands_sep = ','; + if (!grouping || !*grouping) + grouping = "\3"; goto rflag; case '.': if ((ch = *fmt++) == '*') {