From 4c4d9f81cabe0335a572c8f69cb7e0b59a6e1a95 Mon Sep 17 00:00:00 2001 From: pgen Date: Tue, 19 Apr 2022 22:40:35 +0200 Subject: Continue the code simplification --- smenu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/smenu.c b/smenu.c index 8fc43a4..2002d2a 100644 --- a/smenu.c +++ b/smenu.c @@ -763,6 +763,7 @@ ini_load(const char * filename, win_t * win, term_t * term, limit_t * limits, /* Do nothing. */ /* """"""""""" */ } + if ((cnt = fscanf(f, " %63[^=;\n] = %255[^;\n]", name, value))) { if (cnt == 1) @@ -781,6 +782,7 @@ ini_load(const char * filename, win_t * win, term_t * term, limit_t * limits, if (error) goto out; } + if (fscanf(f, " ;%*[^\n]")) { /* To silence the compiler about unused results. */ @@ -4429,8 +4431,8 @@ get_line_last_word(long line, long last_line) { if (line == last_line) return count - 1; - else - return first_word_in_line_a[line + 1] - 1; + + return first_word_in_line_a[line + 1] - 1; } /* ==================================================================== */ @@ -9268,10 +9270,9 @@ main(int argc, char * argv[]) /* Find the first selectable word (if any) in the input stream. */ /* """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" */ - for (first_selectable = 0; - first_selectable < count && !word_a[first_selectable].is_selectable; - first_selectable++) - ; + first_selectable = 0; + while (first_selectable < count && !word_a[first_selectable].is_selectable) + first_selectable++; /* If not found, abort. */ /* """""""""""""""""""" */ -- cgit v1.2.3