summaryrefslogtreecommitdiffstats
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2020-03-15 16:34:57 +0000
committermillert <millert@openbsd.org>2020-03-15 16:34:57 +0000
commit3d02c75d8081d2cbeef341f34da562505254f387 (patch)
treeaec3bac1a248860aabb5c98e8344a84383b84979 /usr.sbin/smtpd
parentkthread_park() and kthread_stop() don't need PCATCH the linux API does (diff)
downloadwireguard-openbsd-3d02c75d8081d2cbeef341f34da562505254f387.tar.xz
wireguard-openbsd-3d02c75d8081d2cbeef341f34da562505254f387.zip
Add missing casts to unsigned char when using ctype(3).
From Hiltjo Posthuma
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/mail.lmtp.c6
-rw-r--r--usr.sbin/smtpd/smtp_session.c4
-rw-r--r--usr.sbin/smtpd/spfwalk.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/mail.lmtp.c b/usr.sbin/smtpd/mail.lmtp.c
index f427e73dc35..c7dc46d5ec3 100644
--- a/usr.sbin/smtpd/mail.lmtp.c
+++ b/usr.sbin/smtpd/mail.lmtp.c
@@ -255,9 +255,9 @@ lmtp_engine(int fd_read, struct session *session)
line[strcspn(line, "\r")] = '\0';
if (linelen < 4 ||
- !isdigit(line[0]) ||
- !isdigit(line[1]) ||
- !isdigit(line[2]) ||
+ !isdigit((unsigned char)line[0]) ||
+ !isdigit((unsigned char)line[1]) ||
+ !isdigit((unsigned char)line[2]) ||
(line[3] != ' ' && line[3] != '-'))
errx(EX_TEMPFAIL, "LMTP server sent an invalid line");
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 87ae18a6667..d6c45b92797 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.424 2020/02/03 15:53:52 gilles Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.425 2020/03/15 16:34:57 millert Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -452,7 +452,7 @@ header_address_rewrite_buffer(char *buffer, const char *address, size_t len)
pos_component_beg = 0;
else {
for (pos_component_beg = pos_component_end; pos_component_beg >= 0; --pos_component_beg)
- if (buffer[pos_component_beg] == ')' || isspace(buffer[pos_component_beg]))
+ if (buffer[pos_component_beg] == ')' || isspace((unsigned char)buffer[pos_component_beg]))
break;
pos_component_beg += 1;
pos_component_end += 1;
diff --git a/usr.sbin/smtpd/spfwalk.c b/usr.sbin/smtpd/spfwalk.c
index 97104eb9105..130c7221fb0 100644
--- a/usr.sbin/smtpd/spfwalk.c
+++ b/usr.sbin/smtpd/spfwalk.c
@@ -95,7 +95,7 @@ spfwalk(int argc, struct parameter *argv)
tgt.dispatch = dispatch_txt;
while ((linelen = getline(&line, &linesize, stdin)) != -1) {
- while (linelen-- > 0 && isspace(line[linelen]))
+ while (linelen-- > 0 && isspace((unsigned char)line[linelen]))
line[linelen] = '\0';
if (linelen > 0)