From: Michael Orlitzky Date: Sun, 5 Jul 2026 18:13:35 +0000 (-0400) Subject: main.c: just say "no" in the suffix test result X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=d61c4548f322b6cf26a18c2a14b16ca47a62e098;p=iconv-quirks.git main.c: just say "no" in the suffix test result --- diff --git a/main.c b/main.c index dc47500..238ddd1 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,7 @@ #include #include #include +#include #include /* The various invalid sequences can be inferred from the table of @@ -97,15 +98,17 @@ int _my_iconv_close(iconv_t* cd) { */ int test_iconv_open_supports_suffix(const char* suffix) { const char* fromcode = "ASCII"; - char tocode[64] = "ASCII"; + char* tocode = malloc(strlen(fromcode) + strlen(suffix) + 1); + strcat(tocode, fromcode); strcat(tocode, suffix); printf("iconv_open() supports %s suffix...", suffix); iconv_t cd = iconv_open(tocode, fromcode); + free(tocode); if (cd == (iconv_t)(-1)) { switch (errno) { case EINVAL: - printf("OK (EINVAL, not supported)\n"); + printf("no\n"); return UNSUPPORTED; default: printf("FAIL (errno=%d, unexpected error)\n", errno);