Skip to content

Commit

Permalink
Fix bug that makes all chars > 0x7f be treated as control chars,
Browse files Browse the repository at this point in the history
regardless of locale setting.
This was a logic error in a60cc1b.
  • Loading branch information
gwsw committed May 15, 2024
1 parent ac0230c commit d5bf864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public lbool binary_char(LWCHAR c)
{
if (utf_mode)
return (is_ubin_char(c));
if (!is_ascii_char(c))
if (c >= sizeof(chardef))
return TRUE;
return ((chardef[c] & IS_BINARY_CHAR) != 0);
}
Expand All @@ -499,7 +499,7 @@ public lbool binary_char(LWCHAR c)
*/
public lbool control_char(LWCHAR c)
{
if (!is_ascii_char(c))
if (c >= sizeof(chardef))
return TRUE;
return (chardef[c] & IS_CONTROL_CHAR);
}
Expand Down

0 comments on commit d5bf864

Please sign in to comment.