summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2022-04-09 21:54:38 +0930
committerAdrian Johnson <ajohnson@redneon.com>2022-04-09 22:08:57 +0930
commit5b18aeffbbd1641962f2ae374a3cb773fe7a6d6e (patch)
tree372b56c4369e8d49856ac74e98c17a716cb6efc3 /util
parent20a54465c597b4f90ab35d73cab25b6e89dfa9bb (diff)
downloadcairo-5b18aeffbbd1641962f2ae374a3cb773fe7a6d6e.tar.gz
Replace use of ctype functions with internal version where only ASCII chars are used
In !309 Taylor R Campbell found a number of instances of ctype incorrectly passed a signed char. In many cases, where only ASCII characters are used, the code should have been using the cairo version of the ctype function to avoid locale issues.
Diffstat (limited to 'util')
-rw-r--r--util/cairo-trace/trace.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index fd9a4a38a..61e57f4d8 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -47,6 +47,8 @@
# include <cairo-ft.h>
#endif
+#include "cairo-ctype-inline.h"
+
#ifndef TRUE
#define TRUE 1
#define FALSE 0
@@ -565,7 +567,7 @@ _trace_dtostr (char *buffer, size_t size, double d)
if (*p == '+' || *p == '-')
p++;
- while (isdigit (*p))
+ while (_cairo_isdigit (*p))
p++;
if (strncmp (p, decimal_point, decimal_point_len) == 0)
@@ -585,7 +587,7 @@ _trace_dtostr (char *buffer, size_t size, double d)
if (*p == '+' || *p == '-')
p++;
- while (isdigit (*p))
+ while (_cairo_isdigit (*p))
p++;
if (strncmp (p, decimal_point, decimal_point_len) == 0) {
@@ -651,7 +653,7 @@ _trace_vprintf (const char *fmt, va_list ap)
f++;
}
- while (isdigit (*f))
+ while (_cairo_isdigit (*f))
f++;
length_modifier = 0;
@@ -1850,7 +1852,7 @@ _encode_string_literal (char *out, int max,
max -= 2;
break;
default:
- if (isprint (c) || isspace (c)) {
+ if (_cairo_isprint (c)) {
*out++ = c;
} else {
int octal = 0;
@@ -1920,7 +1922,7 @@ ESCAPED_CHAR:
_trace_printf ("\\%c", c);
break;
default:
- if (isprint (c) || isspace (c)) {
+ if (_cairo_isprint (c)) {
_trace_printf ("%c", c);
} else {
char buf[4] = { '\\' };