From: dv Date: Thu, 15 Dec 2022 16:01:40 +0000 (+0000) Subject: Add explicit casts to ctype functions in vmd(8). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=70fdfbb3aacc77f71ba7aabd515baf0678ce04d2;p=openbsd Add explicit casts to ctype functions in vmd(8). OK millert@ --- diff --git a/usr.sbin/vmd/priv.c b/usr.sbin/vmd/priv.c index 2074de3b05f..860aac3f5f7 100644 --- a/usr.sbin/vmd/priv.c +++ b/usr.sbin/vmd/priv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: priv.c,v 1.19 2021/11/29 05:17:35 deraadt Exp $ */ +/* $OpenBSD: priv.c,v 1.20 2022/12/15 16:01:40 dv Exp $ */ /* * Copyright (c) 2016 Reyk Floeter @@ -319,7 +319,7 @@ priv_validgroup(const char *name) if (strlen(name) >= IF_NAMESIZE) return (-1); /* Group can not end with a digit */ - if (name[0] && isdigit(name[strlen(name) - 1])) + if (name[0] && isdigit((unsigned char)name[strlen(name) - 1])) return (-1); return (0); } diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index bd0d8580ffc..c7e22c0011a 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.133 2022/10/31 14:02:11 dv Exp $ */ +/* $OpenBSD: vmd.c,v 1.134 2022/12/15 16:01:40 dv Exp $ */ /* * Copyright (c) 2015 Reyk Floeter @@ -1349,8 +1349,8 @@ vm_register(struct privsep *ps, struct vmop_create_params *vmc, goto fail; } else { for (s = vcp->vcp_name; *s != '\0'; ++s) { - if (!(isalnum(*s) || *s == '.' || *s == '-' || - *s == '_')) { + if (!(isalnum((unsigned char)*s) || *s == '.' || \ + *s == '-' || *s == '_')) { log_warnx("invalid VM name"); goto fail; } @@ -1896,7 +1896,7 @@ get_string(uint8_t *ptr, size_t len) size_t i; for (i = 0; i < len; i++) - if (!isprint(ptr[i])) + if (!isprint((unsigned char)ptr[i])) break; return strndup(ptr, i);