summaryrefslogtreecommitdiff
path: root/graphics/cairo/patches/patch-util_cairo-trace_trace.c
blob: 043e48e4e781ff2e9f14900ba300fd9e77bb3357 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$NetBSD: patch-util_cairo-trace_trace.c,v 1.2 2022/04/07 10:57:57 riastradh Exp $

Fix ctype(3) abuse.
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/309

--- util/cairo-trace/trace.c.orig	2018-10-16 17:03:13.000000000 +0000
+++ util/cairo-trace/trace.c
@@ -564,7 +564,7 @@ _trace_dtostr (char *buffer, size_t size
 	if (*p == '+' || *p == '-')
 	    p++;
 
-	while (isdigit (*p))
+	while (isdigit ((unsigned char)*p))
 	    p++;
 
 	if (strncmp (p, decimal_point, decimal_point_len) == 0)
@@ -584,7 +584,7 @@ _trace_dtostr (char *buffer, size_t size
     if (*p == '+' || *p == '-')
 	p++;
 
-    while (isdigit (*p))
+    while (isdigit ((unsigned char)*p))
 	p++;
 
     if (strncmp (p, decimal_point, decimal_point_len) == 0) {
@@ -650,7 +650,7 @@ _trace_vprintf (const char *fmt, va_list
 	    f++;
         }
 
-	while (isdigit (*f))
+	while (isdigit ((unsigned char)*f))
 	    f++;
 
 	length_modifier = 0;
@@ -1848,7 +1848,7 @@ _encode_string_literal (char *out, int m
 	    max -= 2;
 	    break;
 	default:
-	    if (isprint (c) || isspace (c)) {
+	    if (isprint ((unsigned char)c) || isspace ((unsigned char)c)) {
 		*out++ = c;
 	    } else {
 		int octal = 0;
@@ -1918,7 +1918,7 @@ ESCAPED_CHAR:
 	    _trace_printf ("\\%c", c);
 	    break;
 	default:
-	    if (isprint (c) || isspace (c)) {
+	    if (isprint ((unsigned char)c) || isspace ((unsigned char)c)) {
 		_trace_printf ("%c", c);
 	    } else {
 		char buf[4] = { '\\' };