From 6afa4628f31d302e220f38c6ca4dc395100bd6e4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 28 Jul 1999 16:03:02 +0000 Subject: [PATCH] Fix last patch. --- string/bits/string2.h | 3 ++- wcsmbs/wcsrtombs.c | 20 ++++++++++---------- wcsmbs/wctob.c | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/string/bits/string2.h b/string/bits/string2.h index d81f02fb5d5..4bf39e1d952 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -186,7 +186,8 @@ __STRING2_COPY_TYPE (8); /* GCC optimizes memset(s, 0, n) but not bzero(s, n). The optimization is broken before EGCS 1.1. */ -# if __GNUC_PREREQ (2, 91) +# if defined __GNUC__ \ + && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 90)) # define __bzero(s, n) __builtin_memset (s, '\0', n) # endif diff --git a/wcsmbs/wcsrtombs.c b/wcsmbs/wcsrtombs.c index a8105d5b852..1212fa49a00 100644 --- a/wcsmbs/wcsrtombs.c +++ b/wcsmbs/wcsrtombs.c @@ -79,9 +79,9 @@ __wcsrtombs (dst, src, len, ps) /* Count the number of bytes. */ result += data.__outbuf - buf; } - while (status == __GCONV_FULL_OUTPUT); + while (status == GCONV_FULL_OUTPUT); - if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT) + if (status == GCONV_OK || status == GCONV_EMPTY_INPUT) { /* There better should be a NUL byte at the end. */ assert (data.__outbuf[-1] == '\0'); @@ -109,8 +109,8 @@ __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 + || status == GCONV_FULL_OUTPUT) && data.__outbuf[-1] == '\0') { assert (data.__outbuf != (unsigned char *) dst); @@ -122,13 +122,13 @@ __wcsrtombs (dst, src, len, ps) /* There must not be any problems with the conversion but illegal input characters. */ - assert (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT - || status == __GCONV_ILLEGAL_INPUT - || status == __GCONV_INCOMPLETE_INPUT - || status == __GCONV_FULL_OUTPUT); + assert (status == GCONV_OK || status == GCONV_EMPTY_INPUT + || status == GCONV_ILLEGAL_INPUT + || status == GCONV_INCOMPLETE_INPUT + || status == GCONV_FULL_OUTPUT); - if (status != __GCONV_OK && status != __GCONV_FULL_OUTPUT - && status != __GCONV_EMPTY_INPUT) + if (status != GCONV_OK && status != GCONV_FULL_OUTPUT + && status != GCONV_EMPTY_INPUT) { result = (size_t) -1; __set_errno (EILSEQ); diff --git a/wcsmbs/wctob.c b/wcsmbs/wctob.c index 97a36f8d034..93e0d6ae116 100644 --- a/wcsmbs/wctob.c +++ b/wcsmbs/wctob.c @@ -57,8 +57,8 @@ wctob (c) (const unsigned char *) &inbuf[1], &dummy, 0); /* The conversion failed or the output is too long. */ - if ((status != __GCONV_OK && status != __GCONV_FULL_OUTPUT - && status != __GCONV_EMPTY_INPUT) + if ((status != GCONV_OK && status != GCONV_FULL_OUTPUT + && status != GCONV_EMPTY_INPUT) || data.__outbuf != (unsigned char *) (buf + 1)) return EOF; -- 2.47.3