From c5ca51d282da984a92074acdc8977ed580e8cdd5 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 31 Aug 2013 19:57:01 -0500 Subject: [PATCH 1/1] translate_text_to_tstr(): Correctly compare byte values --- programs/imagex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/imagex.c b/programs/imagex.c index 4efb7a22..772b86ef 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -937,8 +937,8 @@ translate_text_to_tstr(char *text, size_t num_bytes, size_t *num_tchars_ret) size_t num_wchars; if (num_bytes >= 2 && - ((text[0] == 0xff && text[1] == 0xfe) || - (text[0] <= 0x7f && text[1] == 0x00))) + (((unsigned char)text[0] == 0xff && (unsigned char)text[1] == 0xfe) || + ((unsigned char)text[0] <= 0x7f && (unsigned char)text[1] == 0x00))) { /* File begins with 0xfeff, the BOM for UTF-16LE, or it begins * with something that looks like an ASCII character encoded as -- 2.43.0