diff options
author | millert <millert@openbsd.org> | 2020-03-15 16:34:57 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 2020-03-15 16:34:57 +0000 |
commit | 277c2536ce1b3a269e8a6ce7298905340945d89c (patch) | |
tree | 5a00f78b18246a888e8dd534f3dadd4caef39d1a | |
parent | Rewrite qp_encoded_write. (diff) | |
download | OpenSMTPD-277c2536ce1b3a269e8a6ce7298905340945d89c.tar.xz OpenSMTPD-277c2536ce1b3a269e8a6ce7298905340945d89c.zip |
Add missing casts to unsigned char when using ctype(3).
From Hiltjo Posthuma
-rw-r--r-- | mail.lmtp.c | 6 | ||||
-rw-r--r-- | smtp_session.c | 4 | ||||
-rw-r--r-- | spfwalk.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/mail.lmtp.c b/mail.lmtp.c index f427e73d..c7dc46d5 100644 --- a/mail.lmtp.c +++ b/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/smtp_session.c b/smtp_session.c index 87ae18a6..d6c45b92 100644 --- a/smtp_session.c +++ b/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; @@ -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) |