]> granicus.if.org Git - fortune-mod/commitdiff
fix some C compiler warnings when not using lib-recode
authorShlomi Fish <shlomif@shlomifish.org>
Mon, 24 Aug 2020 17:59:44 +0000 (20:59 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Mon, 24 Aug 2020 17:59:44 +0000 (20:59 +0300)
fortune-mod/fortune/fortune.c

index 5edd57b2a679cca7691662f9071783599b95b21a..6f8e5f404120ac57a281d06372740090af6d7d4b 100644 (file)
@@ -1774,7 +1774,10 @@ static void free_desc(FILEDESC *ptr)
 
 int main(int ac, char *av[])
 {
+#ifdef WITH_RECODE
     const char *ctype;
+#endif
+
     int exit_code = 0;
     env_lang = getenv("LC_ALL");
     if (!env_lang)
@@ -1800,6 +1803,8 @@ int main(int ac, char *av[])
 #endif
 
     setlocale(LC_ALL, "");
+
+#ifdef WITH_RECODE
 #ifdef _WIN32
     ctype = "C";
 #else
@@ -1813,8 +1818,6 @@ int main(int ac, char *av[])
         ctype = "ISO-8859-1";
     }
 #endif
-
-#ifdef WITH_RECODE
     const size_t do_len = strlen(ctype) + 7 + 1;
     char *crequest = do_malloc(do_len + 1);
     snprintf(crequest, do_len, "UTF-8..%s", ctype);