From 880256b8bfde746cd54993f3abcb4dc648895af7 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 28 Mar 2022 18:36:20 +0200 Subject: compatibility: replace iscntrl with own ISCNTRL macro It is unspecified if the C locale iscntrl is compatible with ASCII or not. Noticed when testing on OpenBSD 3.8 which uses extended ASCII and also uses the C1 range for control-characters. This breaks support with UTF-8. Reference: https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_control_codes_for_general_use C1 table. Force an own definition of an ASCII-compatible control-character range since sfeed expects input to be UTF-8 (or converted from iconv) and so output to be UTF-8 aswell. --- sfeed_opml_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sfeed_opml_import.c') diff --git a/sfeed_opml_import.c b/sfeed_opml_import.c index 6c0bd0e..9a13e36 100644 --- a/sfeed_opml_import.c +++ b/sfeed_opml_import.c @@ -12,7 +12,7 @@ static void printsafe(const char *s) { for (; *s; s++) { - if (iscntrl((unsigned char)*s)) + if (ISCNTRL((unsigned char)*s)) continue; else if (*s == '\\') fputs("\\\\", stdout); -- cgit v1.2.3