aboutsummaryrefslogtreecommitdiff
path: root/gg.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-11-17 09:21:38 +0000
committerOmar Polo <op@omarpolo.com>2022-11-17 09:21:38 +0000
commit6130e0eeac9db4fa8e6fe5934ec2d0ab202f979e (patch)
tree1aff25c6cc404219c7f8f5e29f05da7e8caab24d /gg.c
parent71cac3a08bf84e8b9f8d52999df34913ef4efc55 (diff)
always cast is*() arguments to unsigned char
Diffstat (limited to 'gg.c')
-rw-r--r--gg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gg.c b/gg.c
index 35ccc29..e650737 100644
--- a/gg.c
+++ b/gg.c
@@ -248,7 +248,9 @@ get(const char *r)
if (memmem(buf, len, "\r\n", 2) == NULL)
errx(1, "invalid reply: no \\r\\n");
- if (!isdigit(buf[0]) || !isdigit(buf[1]) || buf[2] != ' ')
+ if (!isdigit((unsigned char)buf[0]) ||
+ !isdigit((unsigned char)buf[1]) ||
+ buf[2] != ' ')
errx(1, "invalid reply: invalid response format");
code = (buf[0] - '0') * 10 + buf[1] - '0';