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 <kzak@redhat.com>
This commit is contained in:
Karel Zak 2020-09-01 11:50:11 +02:00
parent 57898c3a7e
commit 42fa381b9d
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}