* libc/ctype/tolower.c (tolower): Cast conversion result from
mbtowc/wctomb to unsigned char to avoid negative return values. * libc/ctype/toupper.c (toupper): Ditto.
This commit is contained in:
parent
962082b91a
commit
5c1939c8c4
@ -1,3 +1,9 @@
|
|||||||
|
2009-06-09 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* libc/ctype/tolower.c (tolower): Cast conversion result from
|
||||||
|
mbtowc/wctomb to unsigned char to avoid negative return values.
|
||||||
|
* libc/ctype/toupper.c (toupper): Ditto.
|
||||||
|
|
||||||
2009-06-03 IWAMURO Motonori <deenheart@gmail.com>
|
2009-06-03 IWAMURO Motonori <deenheart@gmail.com>
|
||||||
|
|
||||||
* libc/string/wcwidth.c: Optimize for speed.
|
* libc/string/wcwidth.c: Optimize for speed.
|
||||||
|
@ -67,7 +67,7 @@ _DEFUN(tolower,(c),int c)
|
|||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
if (mbtowc (&wc, s, 1) >= 0
|
if (mbtowc (&wc, s, 1) >= 0
|
||||||
&& wctomb (s, (wchar_t) towlower ((wint_t) wc)) == 1)
|
&& wctomb (s, (wchar_t) towlower ((wint_t) wc)) == 1)
|
||||||
c = s[0];
|
c = (unsigned char) s[0];
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
#else
|
#else
|
||||||
|
@ -66,7 +66,7 @@ _DEFUN(toupper,(c),int c)
|
|||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
if (mbtowc (&wc, s, 1) >= 0
|
if (mbtowc (&wc, s, 1) >= 0
|
||||||
&& wctomb (s, (wchar_t) towupper ((wint_t) wc)) == 1)
|
&& wctomb (s, (wchar_t) towupper ((wint_t) wc)) == 1)
|
||||||
c = s[0];
|
c = (unsigned char) s[0];
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user