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
parent
09e4c86606
commit
b6a32fbd5f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue