From bdc8608705cfa91eeb5eaae2e4d11ebaecd6aa62 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 27 Jun 2023 09:58:47 -0700 Subject: [PATCH] diff: tweak mbrtoc32 use * src/side.c (print_half_line): Use more-intuitive way to test whether mbrtoc32 found a non-null character. --- src/side.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/side.c b/src/side.c index 424d933..2f566f8 100644 --- a/src/side.c +++ b/src/side.c @@ -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)