From 67b62c7294984eaa3b199765dd76b258dc979473 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 31 May 2021 13:25:11 -0700 Subject: Added lots of extra compiler checks and fixed a few minor issues. --- draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'draw.c') diff --git a/draw.c b/draw.c index 24dd8bc..01ed4f3 100644 --- a/draw.c +++ b/draw.c @@ -46,7 +46,7 @@ static char* stpcpy_escaped(char *buf, const char *str, const char *color) if (*c > 0 && *c <= '\x1b' && escapes[(int)*c] != ' ') { // "\n", etc. buf += sprintf(buf, "\033[31m\\%c%s", escapes[(int)*c], color); } else if (*c >= 0 && !(' ' <= *c && *c <= '~')) { // "\x02", etc. - buf += sprintf(buf, "\033[31m\\x%02X%s", *c, color); + buf += sprintf(buf, "\033[31m\\x%02X%s", (unsigned int)*c, color); } else { *(buf++) = *c; } @@ -69,7 +69,7 @@ static int fputs_escaped(FILE *f, const char *str, const char *color) fprintf(f, "\033[31m\\%c%s", escapes[(int)*c], color); ++escaped; } else if (*c >= 0 && !(' ' <= *c && *c <= '~')) { // "\x02", etc. - fprintf(f, "\033[31m\\x%02X%s", *c, color); + fprintf(f, "\033[31m\\x%02X%s", (unsigned int)*c, color); ++escaped; } else { fputc(*c, f); -- cgit v1.2.3