From 42fa381b9ddfb17a347d50923b2741fdd48bc300 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 1 Sep 2020 11:50:11 +0200 Subject: [PATCH] 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 --- text-utils/pg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.3