commit b6a32fbd5f575b2eedcce560ee1a0a0d458fba75
parent 09e4c86606a9ca688a930089a42d87695e95874d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 7 Apr 2021 16:02:25 +0200
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.
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/chars.c b/src/chars.c
@@ -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;
}