avoid overflow

This commit is contained in:
V'itor Santos Costa 2016-02-11 05:53:47 -08:00
parent 55deb884d4
commit b13dc6812c

View File

@ -330,12 +330,12 @@ Atom Yap_LookupMaybeWideAtomWithLength(
while (i < len0) { while (i < len0) {
// primary support for atoms with null chars // primary support for atoms with null chars
wchar_t c = atom[i]; wchar_t c = atom[i];
if (c > 255) { if (c >= 255) {
wide = TRUE; wide = true;
break; break;
} }
if (c == '\0') { if (c == '\0') {
len0 = i; wide = true;
break; break;
} }
i++; i++;