From d5ee385b4b5f19934a00408a2addc70f965ea4a9 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 29 Mar 2022 11:03:54 +0200 Subject: compatibility: reduce the assumption the builtin libc locale is ASCII-compatible This is not clearly defined by the C99 standard. Define ctype-like macros to force it to be ASCII / UTF-8 (not extended ASCII or something like noticed on OpenBSD 3.8). (In practise modern libc libraries are all ASCII and UTF-8-compatible. Otherwise this would break many programs) --- sfeed_xmlenc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sfeed_xmlenc.c') diff --git a/sfeed_xmlenc.c b/sfeed_xmlenc.c index 67d7b0f..7fc93ae 100644 --- a/sfeed_xmlenc.c +++ b/sfeed_xmlenc.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -26,10 +25,10 @@ xmlattr(XMLParser *p, const char *t, size_t tl, const char *n, size_t nl, return; for (; *v; v++) { - if (isalpha((unsigned char)*v) || - isdigit((unsigned char)*v) || + if (ISALPHA((unsigned char)*v) || + ISDIGIT((unsigned char)*v) || *v == '.' || *v == ':' || *v == '-' || *v == '_') - putchar(tolower((unsigned char)*v)); + putchar(TOLOWER((unsigned char)*v)); } } -- cgit v1.2.3