]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Fix --disable-widechar compile warnings
authorMarc Aurèle La France <tsi@tuyoix.net>
Sun, 26 Jan 2025 17:38:52 +0000 (10:38 -0700)
committerKarel Zak <kzak@redhat.com>
Wed, 29 Jan 2025 11:49:54 +0000 (12:49 +0100)
Fix warnings when compiling without wide char support.

Marc.

lib/mbsedit.c
text-utils/pg.c

index 9cf4f0f8855fbe7486770f9399894b0a157d0987..8408cc28ba766e003163020c765bff6414e2b623 100644 (file)
@@ -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;
index 8e01a9a5bd2ed210b1b4eb8e5c4087f6f1c4b15d..6d67bc579c5f9986c62147360cf72958ab0fbafc 100644 (file)
@@ -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_("\