ctype-utf8.c, ctype-sjis.c:

Safer and mode readable way.


strings/ctype-sjis.c:
  Safer and mode readable way.
strings/ctype-utf8.c:
  Safer and mode readable way.
This commit is contained in:
unknown 2005-03-29 16:23:44 +05:00
commit 0b45706c3b
2 changed files with 3 additions and 13 deletions

View file

@ -4576,12 +4576,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
const char *b0= b;
while (pos && b < e)
{
/*
Cast to int8 for extra safety.
"char" can be unsigned by default
on some platforms.
*/
if (((int8)b[0]) >= 0)
if ((uchar) b[0] < 128)
{
/* Single byte ascii character */
b++;