Module Name: src
Committed By: gson
Date: Mon Mar 25 15:31:03 UTC 2013
Modified Files:
src/tests/lib/libc/locale: t_wctomb.c
Log Message:
Don't size an array using MB_CUR_MAX while one locale is in effect and
then use it with another locale having a larger MB_CUR_MAX. This
should fix the t_wctomb:wcrtomb_state test failures seen on i386.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/locale/t_wctomb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/locale/t_wctomb.c
diff -u src/tests/lib/libc/locale/t_wctomb.c:1.2 src/tests/lib/libc/locale/t_wctomb.c:1.3
--- src/tests/lib/libc/locale/t_wctomb.c:1.2 Sat Jun 11 18:03:18 2011
+++ src/tests/lib/libc/locale/t_wctomb.c Mon Mar 25 15:31:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: t_wctomb.c,v 1.2 2011/06/11 18:03:18 christos Exp $ */
+/* $NetBSD: t_wctomb.c,v 1.3 2013/03/25 15:31:03 gson Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2011\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_wctomb.c,v 1.2 2011/06/11 18:03:18 christos Exp $");
+__RCSID("$NetBSD: t_wctomb.c,v 1.3 2013/03/25 15:31:03 gson Exp $");
#include <stdio.h>
#include <stdlib.h>
@@ -63,6 +63,7 @@ __RCSID("$NetBSD: t_wctomb.c,v 1.2 2011/
#include <vis.h>
#include <wchar.h>
#include <string.h>
+#include <limits.h>
#include <atf-c.h>
@@ -100,7 +101,7 @@ h_wctomb(const struct test *t, char tc)
{
wchar_t wcs[16 + 2];
char buf[128];
- char cs[MB_CUR_MAX];
+ char cs[MB_LEN_MAX];
const char *pcs;
char *str;
mbstate_t st;