From: Ulrich Drepper Date: Fri, 21 Apr 2000 06:58:22 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc_2-1-91~548 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=376b8b3de93bcb3bb4a739d62bc02895f6eba227;p=platform%2Fupstream%2Fglibc.git Update. * wcsmbs/wcsrtombs.c (__wcsrtombs): If output buffer is too small don't search for NUL byte to decrement counter. Reported by Ulrich.Brink@sap.com. --- diff --git a/ChangeLog b/ChangeLog index 268c7ea..a62bc29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2000-04-20 Ulrich Drepper + * wcsmbs/wcsrtombs.c (__wcsrtombs): If output buffer is too small + don't search for NUL byte to decrement counter. + Reported by Ulrich.Brink@sap.com. + * iconv/gconv_simple.c: Define separate functions to convert from UCS4/UCS4-LE to the internal encoding. * iconv/gconv_builtin.h: Use separate functions to convert from diff --git a/wcsmbs/wcsrtombs.c b/wcsmbs/wcsrtombs.c index cbb39d3..28af214 100644 --- a/wcsmbs/wcsrtombs.c +++ b/wcsmbs/wcsrtombs.c @@ -114,8 +114,7 @@ __wcsrtombs (dst, src, len, ps) /* We have to determine whether the last character converted is the NUL character. */ - if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT - || status == __GCONV_FULL_OUTPUT) + if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT) && data.__outbuf[-1] == '\0') { assert (data.__outbuf != (unsigned char *) dst);