diff: tweak mbrtoc32 use

* src/side.c (print_half_line): Use more-intuitive
way to test whether mbrtoc32 found a non-null character.
This commit is contained in:
Paul Eggert 2023-06-27 09:58:47 -07:00
parent d4a63b11fc
commit bdc8608705

View File

@ -138,7 +138,7 @@ print_half_line (char const *const *line, intmax_t indent, intmax_t out_bound)
char32_t wc;
size_t bytes = mbrtoc32 (&wc, tp0, text_limit - tp0, &mbstate);
if (0 < bytes && bytes < (size_t) -2)
if (0 < bytes && bytes <= MB_LEN_MAX)
{
int width = c32width (wc);
if (0 < width)