Properly check range when chars are signed

This commit is contained in:
Michael Hansen 2011-10-02 19:51:54 -07:00
commit 29edae5685

View file

@ -95,7 +95,7 @@ void OutputString(PycRef<PycString> str, char prefix, bool triple, FILE* F)
} else {
fprintf(F, "\\x%x", (*ch & 0xFF));
}
} else if (*ch >= 0x80) {
} else if ((unsigned char)(*ch) >= 0x80) {
if (str->type() == PycObject::TYPE_UNICODE) {
// Unicode stored as UTF-8... Let the stream interpret it
fputc(*ch, F);