From 92183857dc35690a1cebd5459f77234b403aa0fc Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Mon, 24 Aug 2020 20:59:44 +0300 Subject: [PATCH] fix some C compiler warnings when not using lib-recode --- fortune-mod/fortune/fortune.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fortune-mod/fortune/fortune.c b/fortune-mod/fortune/fortune.c index 5edd57b..6f8e5f4 100644 --- a/fortune-mod/fortune/fortune.c +++ b/fortune-mod/fortune/fortune.c @@ -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); -- 2.40.0