Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/locale Don't size an array using MB_CUR_MAX w...



details:   https://anonhg.NetBSD.org/src/rev/f398e68010c7
branches:  trunk
changeset: 785697:f398e68010c7
user:      gson <gson%NetBSD.org@localhost>
date:      Mon Mar 25 15:31:03 2013 +0000

description:
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.

diffstat:

 tests/lib/libc/locale/t_wctomb.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r c1636ffa6264 -r f398e68010c7 tests/lib/libc/locale/t_wctomb.c
--- a/tests/lib/libc/locale/t_wctomb.c  Mon Mar 25 12:59:59 2013 +0000
+++ b/tests/lib/libc/locale/t_wctomb.c  Mon Mar 25 15:31:03 2013 +0000
@@ -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 @@
 #include <vis.h>
 #include <wchar.h>
 #include <string.h>
+#include <limits.h>
 
 #include <atf-c.h>
 
@@ -100,7 +101,7 @@
 {
        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;



Home | Main Index | Thread Index | Old Index