From 9a964edea988ea7ffe548351529ee0aeb49ff3aa Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 30 Sep 2023 20:11:55 +0300 Subject: [PATCH] (edit_print_string): refactor loop. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index dc3b3228b..11e069004 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -1687,10 +1687,10 @@ edit_move_block_to_left (WEdit * edit) static size_t edit_print_string (WEdit * e, const char *s) { - size_t i = 0; + size_t i; - while (s[i] != '\0') - edit_execute_cmd (e, CK_InsertChar, (unsigned char) s[i++]); + for (i = 0; s[i] != '\0'; i++) + edit_execute_cmd (e, CK_InsertChar, (unsigned char) s[i]); e->force |= REDRAW_COMPLETELY; edit_update_screen (e); return i;