Project

General

Profile

Submit #2920 » eilseq_fix.patch

Patch - RockinRoel, 06/08/2016 04:06 AM

View differences:

lib/libc/locale/ascii.c
if (dst == NULL) {
s = memchr(*src, '\0', nms);
if (*s & 0x80) {
*src = s;
errno = EILSEQ;
return ((size_t)-1);
}
......
nchr = 0;
while (len-- > 0 && nwc-- > 0) {
if (*s < 0 || *s > 127) {
*src = s;
errno = EILSEQ;
return ((size_t)-1);
}
lib/libc/locale/none.c
nchr = 0;
while (len-- > 0 && nwc-- > 0) {
if (*s < 0 || *s > UCHAR_MAX) {
*src = s;
errno = EILSEQ;
return ((size_t)-1);
}
(2-2/3)