Skip to content

Commit

Permalink
throw less #5519
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Sep 3, 2021
1 parent af5c6e4 commit 20a259c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/util/zstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) {
}
else if (*(s+3+i) == '}') {
if (result > 255 && !uses_unicode())
throw default_exception("unicode characters outside of byte range are not supported");
if (result > unicode_max_char())
throw default_exception("unicode characters outside of byte range are not supported");
return false;
if (result > unicode_max_char())
return false;
s += 4 + i;
return true;
}
Expand All @@ -65,8 +65,8 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) {
result = 16*result + d2;
result = 16*result + d3;
result = 16*result + d4;
if (result > unicode_max_char())
throw default_exception("unicode characters outside of byte range are not supported");
if (result > unicode_max_char())
return false;
s += 6;
return true;
}
Expand Down

0 comments on commit 20a259c

Please sign in to comment.