diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-28 21:30:43 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-28 21:30:43 -0700 |
| commit | 1a8095c6d774e3448f6afa1aeec2bc79c5bb545e (patch) | |
| tree | 31e6a146c9384321dd949f4e51b6e315a08f087a /utils.c | |
| parent | 90b8db84a48ca9ea1311abd202a546a4f697f4e6 (diff) | |
Starting to add better error messages
Diffstat (limited to 'utils.c')
| -rw-r--r-- | utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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, |
