From 6b5d217e22668c54b5c62d1ebd77b5a319540a8a Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 10 May 2026 19:15:54 +0100 Subject: [PATCH] Reduce the scope of end_idx (cppcheck recommendation). --- src/main/help.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/help.c b/src/main/help.c index 2dc8983..1ad15c7 100644 --- a/src/main/help.c +++ b/src/main/help.c @@ -123,7 +123,7 @@ static void display_word_wrap(const char *string, size_t display_width, size_t f size_t wide_char_count; size_t wide_string_buffer_size; wchar_t *wide_string; - size_t start_idx, end_idx, chars_remaining; + size_t start_idx, chars_remaining; debug("[%s], display_width=%d, first_line_start=%d, left_margin=%d", string, (int) display_width, (int) first_line_start, (int) left_margin); @@ -177,7 +177,7 @@ static void display_word_wrap(const char *string, size_t display_width, size_t f /*@-unrecog@ *//* splint doesn't see the prototype for wcswidth(). */ while (chars_remaining > 0 && wcswidth(&(wide_string[start_idx]), chars_remaining) > (int) wrap_at_width) { /*@+unrecog@ */ - size_t next_idx; + size_t next_idx, end_idx; /* * Find the last space before the end of the display line,