fix printing of "negative" byte values

This commit is contained in:
Sven M. Hallberg 2015-09-16 22:17:31 +02:00
parent 7319c48e59
commit cdd1289936
2 changed files with 4 additions and 4 deletions

View file

@ -672,7 +672,7 @@ static void stringset_extend(HCFGrammar *g, HStringMap *ret,
}
void h_pprint_char(FILE *f, char c)
void h_pprint_char(FILE *f, uint8_t c)
{
switch(c) {
case '"': fputs("\\\"", f); break;
@ -685,12 +685,12 @@ void h_pprint_char(FILE *f, char c)
if (isprint((int)c)) {
fputc(c, f);
} else {
fprintf(f, "\\x%.2X", c);
fprintf(f, "\\x%.2X", (unsigned int)c);
}
}
}
static void pprint_charset_char(FILE *f, char c)
static void pprint_charset_char(FILE *f, uint8_t c)
{
switch(c) {
case '"': fputc(c, f); break;