fixed a minor utf8 check bug.

fixed static linking problem regarding the seq module for awk
This commit is contained in:
2014-03-31 01:45:18 +00:00
parent 35839c9f67
commit cfb3eb93ec
6 changed files with 48 additions and 29 deletions

View File

@ -134,8 +134,12 @@ qse_size_t qse_utf8touc (
for (i = 1; i < cur->length; i++)
{
/* in utf8, trailing bytes are all
* set with 0x80. if not, invalid */
if (!(utf8[i] & 0x80)) return 0;
* set with 0x80.
*
* 10XXXXXX & 11000000 => 10000000
*
* if not, invalid. */
if ((utf8[i] & 0xC0) != 0x80) return 0;
w = (w << 6) | (utf8[i] & 0x3F);
}
*uc = w;
@ -145,8 +149,12 @@ qse_size_t qse_utf8touc (
for (i = 1; i < cur->length; i++)
{
/* in utf8, trailing bytes are all
* set with 0x80. if not, invalid */
if (!(utf8[i] & 0x80)) return 0;
* set with 0x80.
*
* 10XXXXXX & 11000000 => 10000000
*
* if not, invalid. */
if ((utf8[i] & 0xC0) != 0x80) return 0;
}
}
}