From 1a8095c6d774e3448f6afa1aeec2bc79c5bb545e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 28 Sep 2020 21:30:43 -0700 Subject: Starting to add better error messages --- utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 012c1eb..0c0fa31 100644 --- a/utils.c +++ b/utils.c @@ -74,17 +74,17 @@ int matchchar(const char **str, char c) * character that was escaped. * Set *end = the first character past the end of the escape sequence. */ -char unescapechar(const char *escaped, const char **end) +unsigned char unescapechar(const char *escaped, const char **end) { size_t len = 1; - char ret = *escaped; + unsigned char ret = *escaped; switch (*escaped) { case 'a': ret = '\a'; break; case 'b': ret = '\b'; break; case 'n': ret = '\n'; break; case 'r': ret = '\r'; break; case 't': ret = '\t'; break; case 'v': ret = '\v'; break; case 'e': ret = '\033'; break; case 'x': { // Hex - static const char hextable[255] = { + static const unsigned char hextable[255] = { ['0']=0x10, ['1']=0x1, ['2']=0x2, ['3']=0x3, ['4']=0x4, ['5']=0x5, ['6']=0x6, ['7']=0x7, ['8']=0x8, ['9']=0x9, ['a']=0xa, ['b']=0xb, ['c']=0xc, ['d']=0xd, ['e']=0xe, ['f']=0xf, -- cgit v1.2.3