From b8a423c2db7442c8e082cd710f3ce052009a12b1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 26 Jul 1999 16:42:39 +0000 Subject: [PATCH] Update. 1999-07-26 Ulrich Drepper * wcsmbs/wcsrtombs.c (__wcsrtombs): When computing maximum number of wide characters to convert do it right and don't overestimate by multiplying with MB_CUR_MAX. Reported by Bruno Haible . --- ChangeLog | 7 +++++++ wcsmbs/wcsrtombs.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d216889..513ae2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-07-26 Ulrich Drepper + + * wcsmbs/wcsrtombs.c (__wcsrtombs): When computing maximum number + of wide characters to convert do it right and don't overestimate + by multiplying with MB_CUR_MAX. + Reported by Bruno Haible . + 1999-07-26 Jakub Jelinek * string/bits/string2.h (__strcpy_small): Avoid compile time warning. diff --git a/wcsmbs/wcsrtombs.c b/wcsmbs/wcsrtombs.c index 5ab8481..a8105d5 100644 --- a/wcsmbs/wcsrtombs.c +++ b/wcsmbs/wcsrtombs.c @@ -94,7 +94,7 @@ __wcsrtombs (dst, src, len, ps) /* This code is based on the safe assumption that all internal multi-byte encodings use the NUL byte only to mark the end of the string. */ - const wchar_t *srcend = *src + __wcsnlen (*src, len * MB_CUR_MAX) + 1; + const wchar_t *srcend = *src + __wcsnlen (*src, len) + 1; size_t dummy; data.__outbuf = dst; -- 2.7.4