diff --git a/src/chars.c b/src/chars.c index c8d1a957..619b7fd9 100644 --- a/src/chars.c +++ b/src/chars.c @@ -197,20 +197,20 @@ int mbwidth(const char *c) return 1; } -/* Convert the Unicode value in code to a multibyte character, if possible. +/* Convert the given Unicode value to a multibyte character, if possible. * If the conversion succeeds, return the (dynamically allocated) multibyte * character and its length. Otherwise, return a length of zero. */ char *make_mbchar(long code, int *length) { char *mb_char = charalloc(MAXCHARLEN); - *length = wctomb(mb_char, (wchar_t)code); + *length = wctomb(mb_char, (wchar_t)code); - /* Reject invalid Unicode characters. */ - if (*length < 0 || !is_valid_unicode((wchar_t)code)) { - IGNORE_CALL_RESULT(wctomb(NULL, 0)); - *length = 0; - } + /* Reject invalid Unicode characters. */ + if (*length < 0 || !is_valid_unicode((wchar_t)code)) { + IGNORE_CALL_RESULT(wctomb(NULL, 0)); + *length = 0; + } return mb_char; }