From 945ac79364e344c1a9de7a1e7daecfa2165e35d2 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 29 Jun 2022 10:34:59 +0200 Subject: [PATCH] scripts: get rid of read variable --- src/config/scripts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/config/scripts.c b/src/config/scripts.c index 3f006f77..aca85173 100644 --- a/src/config/scripts.c +++ b/src/config/scripts.c @@ -112,10 +112,9 @@ scripts_read(const char* const script) char* line = NULL; size_t len = 0; - ssize_t read; GSList* result = NULL; - while ((read = getline(&line, &len, scriptfile)) != -1) { + while (getline(&line, &len, scriptfile) != -1) { if (g_str_has_suffix(line, "\n")) { result = g_slist_append(result, g_strndup(line, strlen(line) - 1)); } else { @@ -150,9 +149,8 @@ scripts_exec(const char* const script) char* line = NULL; size_t len = 0; - ssize_t read; - while ((read = getline(&line, &len, scriptfile)) != -1) { + while (getline(&line, &len, scriptfile) != -1) { ProfWin* win = wins_get_current(); cmd_process_input(win, line); session_process_events();