From e214931fbf4f87aaf5589e3348ea36076106ce73 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Thu, 29 Jul 2004 06:08:31 +0000 Subject: [PATCH] Remove useless checks for characters longer than INT_MAX bytes. --- lib/libc/locale/mblen.c | 4 ---- lib/libc/locale/mbtowc.c | 4 ---- lib/libc/locale/wctomb.c | 4 ---- 3 files changed, 12 deletions(-) diff --git a/lib/libc/locale/mblen.c b/lib/libc/locale/mblen.c index 8486e7173cbf..65d0aa7c478f 100644 --- a/lib/libc/locale/mblen.c +++ b/lib/libc/locale/mblen.c @@ -48,9 +48,5 @@ mblen(const char *s, size_t n) rval = __mbrtowc(NULL, s, n, &mbs); if (rval == (size_t)-1 || rval == (size_t)-2) return (-1); - if (rval > INT_MAX) { - errno = ERANGE; - return (-1); - } return ((int)rval); } diff --git a/lib/libc/locale/mbtowc.c b/lib/libc/locale/mbtowc.c index 994d243fb2c8..8ee280aa2b05 100644 --- a/lib/libc/locale/mbtowc.c +++ b/lib/libc/locale/mbtowc.c @@ -49,9 +49,5 @@ mbtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n) rval = __mbrtowc(pwc, s, n, &mbs); if (rval == (size_t)-1 || rval == (size_t)-2) return (-1); - if (rval > INT_MAX) { - errno = ERANGE; - return (-1); - } return ((int)rval); } diff --git a/lib/libc/locale/wctomb.c b/lib/libc/locale/wctomb.c index 6616a661e891..d9c607e69760 100644 --- a/lib/libc/locale/wctomb.c +++ b/lib/libc/locale/wctomb.c @@ -48,9 +48,5 @@ wctomb(char *s, wchar_t wchar) } if ((rval = __wcrtomb(s, wchar, &mbs)) == (size_t)-1) return (-1); - if (rval > INT_MAX) { - errno = ERANGE; - return (-1); - } return ((int)rval); }