From: Marc Aurèle La France Date: Sun, 26 Jan 2025 17:38:52 +0000 (-0700) Subject: Fix --disable-widechar compile warnings X-Git-Tag: v2.42-start~73^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a659f05cffd6b8beb3154dff74418993ae22ce3;p=thirdparty%2Futil-linux.git Fix --disable-widechar compile warnings Fix warnings when compiling without wide char support. Marc. --- diff --git a/lib/mbsedit.c b/lib/mbsedit.c index 9cf4f0f88..8408cc28b 100644 --- a/lib/mbsedit.c +++ b/lib/mbsedit.c @@ -174,8 +174,8 @@ static size_t mbs_insert(char *str, wint_t c, size_t *ncells) memmove(str + n, str, bytes); memcpy(str, in, n); str[bytes + n] = '\0'; -out: #ifdef HAVE_WIDECHAR +out: free(in); #endif return n; diff --git a/text-utils/pg.c b/text-utils/pg.c index 8e01a9a5b..6d67bc579 100644 --- a/text-utils/pg.c +++ b/text-utils/pg.c @@ -146,7 +146,9 @@ static long startline; /* start line from argv[] */ static int nextfile = 1; /* files to advance */ static jmp_buf jmpenv; /* jump from signal handlers */ static int canjump; /* jmpenv is valid */ +#ifdef HAVE_WIDECHAR static wchar_t wbuf[READBUF]; /* used in several widechar routines */ +#endif static char *copyright; static const char *helpscreen = N_("\