The argument to ctype functions must be EOF or representable as an
authorflorian <florian@openbsd.org>
Thu, 15 Dec 2022 08:06:13 +0000 (08:06 +0000)
committerflorian <florian@openbsd.org>
Thu, 15 Dec 2022 08:06:13 +0000 (08:06 +0000)
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, kn, miod

usr.sbin/acme-client/parse.y

index c9ca9ca..2b0d55f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.44 2022/10/09 09:59:31 op Exp $ */
+/*     $OpenBSD: parse.y,v 1.45 2022/12/15 08:06:13 florian Exp $ */
 
 /*
  * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1101,7 +1101,7 @@ domain_valid(const char *cp)
 
        for ( ; *cp != '\0'; cp++)
                if (!(*cp == '.' || *cp == '-' ||
-                   *cp == '_' || isalnum((int)*cp)))
+                   *cp == '_' || isalnum((unsigned char)*cp)))
                        return 0;
        return 1;
 }