8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00
This commit is contained in:
asfernandes 2006-10-04 02:01:26 +00:00
parent aac5aff3f5
commit 5fb9f93184

View File

@ -183,9 +183,6 @@ INTL_BOOL CVGB_check_gb2312(charset* cs, ULONG gb_len, const UCHAR *gb_str, ULON
while (gb_len--)
{
if (offending_position)
*offending_position = gb_str - gb_str_start;
const UCHAR c1 = *gb_str;
if (c1 & 0x80) // it is not an ASCII char
@ -195,6 +192,9 @@ INTL_BOOL CVGB_check_gb2312(charset* cs, ULONG gb_len, const UCHAR *gb_str, ULON
if (gb_len == 0 || // truncated GB2312
!GB2(gb_str[1])) // bad second byte
{
if (offending_position)
*offending_position = gb_str - gb_str_start;
return false;
}
@ -202,7 +202,12 @@ INTL_BOOL CVGB_check_gb2312(charset* cs, ULONG gb_len, const UCHAR *gb_str, ULON
gb_len -= 1;
}
else // bad first byte
{
if (offending_position)
*offending_position = gb_str - gb_str_start;
return false;
}
}
else // it is an ASCII char
gb_str++;