summaryrefslogtreecommitdiff
path: root/devel/libuuid/patches/patch-lib_colors.c
blob: 59e606ab34a2c0e21ba21fc6fd6711cdf5d910ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$NetBSD: patch-lib_colors.c,v 1.1 2022/04/02 21:00:54 riastradh Exp $

Fix ctype(3) abuse.

--- lib/colors.c.orig	2018-06-04 07:57:02.792445890 +0000
+++ lib/colors.c
@@ -363,7 +363,7 @@ static int cn_sequence(const char *str, 
 	*seq = NULL;
 
 	/* convert logical names like "red" to the real sequence */
-	if (*str != '\\' && isalpha(*str)) {
+	if (*str != '\\' && isalpha((unsigned char)*str)) {
 		const char *s = color_sequence_from_colorname(str);
 		*seq = strdup(s ? s : str);
 
@@ -456,7 +456,7 @@ static int colors_add_scheme(struct ul_c
 	rc = -ENOMEM;
 
 	/* convert logical name (e.g. "red") to real ESC code */
-	if (isalpha(*seq)) {
+	if (isalpha((unsigned char)*seq)) {
 		const char *s = color_sequence_from_colorname(seq);
 		char *p;