aboutsummaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-05-31 13:25:11 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-05-31 13:25:11 -0700
commit67b62c7294984eaa3b199765dd76b258dc979473 (patch)
tree2311b9f5cee690ee523378262f1fd805394eb8bc /draw.c
parent60db11fbb8f5893047aae4289ceccd6b712b5f2d (diff)
Added lots of extra compiler checks and fixed a few minor issues.
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c4
1 files changed, 2 insertions, 2 deletions
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);