PATCH: fix tst_strfmon
Wolfram Gloger
wmglo@dent.med.uni-muenchen.de
Sun Apr 14 23:19:00 GMT 2002
Hi,
I got crashes from tst_strfmon in make check. A buffer was too small
for the Euro tests..
2002-04-14 Wolfram Gloger <wg@malloc.de>
* tests-mbwc/tst_types.h: Increase MONSIZE.
* tests-mbwc/tst_strfmon.c: Fail test if buffer too small.
--- localedata/tests-mbwc/tst_types.h.orig Wed Aug 2 19:55:11 2000
+++ localedata/tests-mbwc/tst_types.h Sun Apr 14 23:25:35 2002
@@ -19,7 +19,7 @@
#define MBSSIZE 24
#define WCSSIZE 12
#define MONFMTSIZE 16
-#define MONSIZE 32
+#define MONSIZE 64
#define USE_MBCURMAX 99 /* well, but ... */
#define TST_DBL_EPS 2.22153e-16
#define WCSTOK_SEQNUM 3
--- localedata/tests-mbwc/tst_strfmon.c.orig Thu Jun 29 10:46:04 2000
+++ localedata/tests-mbwc/tst_strfmon.c Sun Apr 14 23:37:36 2002
@@ -27,6 +27,12 @@
fmt = TST_INPUT (strfmon).fmt;
val = TST_INPUT (strfmon).val;
memset (buf, 0, MONSIZE);
+ if (nbt > MONSIZE)
+ {
+ err_count++;
+ Result (C_FAILURE, S_STRFMON, CASE_3, "buffer too small in test");
+ continue;
+ }
TST_CLEAR_ERRNO;
ret = strfmon (buf, nbt, fmt, val, val, val);
More information about the Libc-alpha
mailing list