From: Karel Zak Date: Tue, 1 Sep 2020 09:50:11 +0000 (+0200) Subject: pg: fix wcstombs() use X-Git-Tag: v2.37-rc1~499 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42fa381b9ddfb17a347d50923b2741fdd48bc300;p=thirdparty%2Futil-linux.git pg: fix wcstombs() use The size (3rd) argument should be ignored if the 1st *dest is NULL, but it seems gcc & glibc headers are more pedantic now: ext-utils/pg.c:456:13: error: argument 1 is null but the corresponding size argument 3 value is 2048 [-Werror=nonnull] Signed-off-by: Karel Zak --- diff --git a/text-utils/pg.c b/text-utils/pg.c index 5d01ebff34..fba7700718 100644 --- a/text-utils/pg.c +++ b/text-utils/pg.c @@ -453,7 +453,7 @@ static char *endline_for_mb(unsigned col, char *s) ended: *end = L'\0'; p = wbuf; - if ((pos = wcstombs(NULL, p, READBUF)) == (size_t)-1) + if ((pos = wcstombs(NULL, p, 0)) == (size_t)-1) return s + 1; return s + pos; }