diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2022-12-14 18:32:27 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2022-12-14 18:32:27 +0000 |
commit | 0b56dd266a6a82c80b5385c047059b43af8bdf30 (patch) | |
tree | 8cdb8afe69821d5fe2cfe68e90b36617a47d9fc2 /usr.sbin | |
parent | d6bf8455c2b7ff65f750ad0f4078a512100d6eb9 (diff) |
The argument to ctype functions must be EOF or representable as an
unsigned char.
Casting to int is particularly useless because that's what the
compiler already does. We need to prevent sign extension, not write
down that we want sign extension.
OK deraadt, millert, kn
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/acme-client/http.c | 4 | ||||
-rw-r--r-- | usr.sbin/acme-client/netproc.c | 8 | ||||
-rw-r--r-- | usr.sbin/acme-client/revokeproc.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/acme-client/http.c b/usr.sbin/acme-client/http.c index da7e2c23607..b7cead5fb2d 100644 --- a/usr.sbin/acme-client/http.c +++ b/usr.sbin/acme-client/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.31 2021/09/14 16:37:20 tb Exp $ */ +/* $Id: http.c,v 1.32 2022/12/14 18:32:26 florian Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -561,7 +561,7 @@ http_head_parse(const struct http *http, struct httpxfer *trans, size_t *sz) } *ccp++ = '\0'; - while (isspace((int)*ccp)) + while (isspace((unsigned char)*ccp)) ccp++; h[hsz].key = cp; h[hsz++].val = ccp; diff --git a/usr.sbin/acme-client/netproc.c b/usr.sbin/acme-client/netproc.c index 1d59de71700..cd1b8716ca7 100644 --- a/usr.sbin/acme-client/netproc.c +++ b/usr.sbin/acme-client/netproc.c @@ -1,4 +1,4 @@ -/* $Id: netproc.c,v 1.32 2022/11/09 19:11:14 mbuhl Exp $ */ +/* $Id: netproc.c,v 1.33 2022/12/14 18:32:26 florian Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -73,13 +73,13 @@ buf_dump(const struct buf *buf) err(EXIT_FAILURE, "malloc"); for (j = 0, i = 0; i < buf->sz; i++) - if (isspace((int)buf->buf[i])) { + if (isspace((unsigned char)buf->buf[i])) { nbuf[j++] = ' '; - while (isspace((int)buf->buf[i])) + while (isspace((unsigned char)buf->buf[i])) i++; i--; } else - nbuf[j++] = isprint((int)buf->buf[i]) ? + nbuf[j++] = isprint((unsigned char)buf->buf[i]) ? buf->buf[i] : '?'; dodbg("transfer buffer: [%.*s] (%zu bytes)", j, nbuf, buf->sz); free(nbuf); diff --git a/usr.sbin/acme-client/revokeproc.c b/usr.sbin/acme-client/revokeproc.c index fee2d56a162..d1dbba7b4e7 100644 --- a/usr.sbin/acme-client/revokeproc.c +++ b/usr.sbin/acme-client/revokeproc.c @@ -1,4 +1,4 @@ -/* $Id: revokeproc.c,v 1.20 2022/12/14 15:44:13 otto Exp $ */ +/* $Id: revokeproc.c,v 1.21 2022/12/14 18:32:26 florian Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -225,7 +225,7 @@ revokeproc(int fd, const char *certfile, int force, while ((tok = strsep(&str, ",")) != NULL) { if (*tok == '\0') continue; - while (isspace((int)*tok)) + while (isspace((unsigned char)*tok)) tok++; if (strncmp(tok, "DNS:", 4)) continue; |