tweaks: elide an unneeded resetting NULL call to wctomb()

Calling wctomb() with NULL as the first parameter returns zero in a
UTF-8 locale, meaning that there is no state, so there is no point
in resetting it either.
master
Benno Schulenberg 2021-04-07 16:02:25 +02:00
parent 09e4c86606
commit b6a32fbd5f
1 changed files with 1 additions and 3 deletions

View File

@ -261,10 +261,8 @@ char *make_mbchar(long code, int *length)
*length = wctomb(mb_char, (wchar_t)code);
if (*length < 0) {
IGNORE_CALL_RESULT(wctomb(NULL, 0));
if (*length < 0)
*length = 0;
}
return mb_char;
}