mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Remove useless checks for characters longer than INT_MAX bytes.
This commit is contained in:
parent
b5bc6d4db0
commit
e214931fbf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132819
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user