aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/indent/io.c
diff options
context:
space:
mode:
authorPiotr Pawel Stefaniak <pstef@FreeBSD.org>2018-06-03 17:03:55 +0000
committerPiotr Pawel Stefaniak <pstef@FreeBSD.org>2018-06-03 17:03:55 +0000
commite1baf57e4b537876b695168c51bb8fd10f7f64f3 (patch)
treecb942ce9b4edf54c79e451e36e0754df88456b70 /usr.bin/indent/io.c
parent95b813e501c28571b59fee006dc86fc09b12222a (diff)
downloadsrc-e1baf57e4b537876b695168c51bb8fd10f7f64f3.tar.gz
src-e1baf57e4b537876b695168c51bb8fd10f7f64f3.zip
indent(1): limit character classification functions' input to unsigned char
Notes
Notes: svn path=/head/; revision=334568
Diffstat (limited to 'usr.bin/indent/io.c')
-rw-r--r--usr.bin/indent/io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c
index 5f0ad9908b30..35f0b7d5a7fc 100644
--- a/usr.bin/indent/io.c
+++ b/usr.bin/indent/io.c
@@ -243,7 +243,7 @@ dump_line(void)
cur_col = 1;
++ps.out_lines;
}
- while (e_com > com_st && isspace(e_com[-1]))
+ while (e_com > com_st && isspace((unsigned char)e_com[-1]))
e_com--;
(void)pad_output(cur_col, target);
fwrite(com_st, e_com - com_st, 1, output);
@@ -638,9 +638,9 @@ parsefont(struct fstate *f, const char *s0)
memset(f, '\0', sizeof(*f));
while (*s) {
- if (isdigit(*s))
+ if (isdigit((unsigned char)*s))
f->size = f->size * 10 + *s - '0';
- else if (isupper(*s))
+ else if (isupper((unsigned char)*s))
if (f->font[0])
f->font[1] = *s;
else