From 7d1d43744afbda7606d2a93037b166bb524559b1 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Fri, 8 Apr 2022 17:00:54 -0700 Subject: [PATCH] trivial cleanup --- src/postfork.cpp | 3 ++- src/screen.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/postfork.cpp b/src/postfork.cpp index 76371c07d..c8505c9ed 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -369,7 +369,7 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const * const char *const *envv) { switch (err) { case E2BIG: { - char sz1[128], sz2[128]; + char sz1[128]; long arg_max = -1; @@ -388,6 +388,7 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const * if (arg_max > 0) { if (sz >= static_cast(arg_max)) { + char sz2[128]; format_size_safe(sz2, static_cast(arg_max)); FLOGF_SAFE(exec, "Failed to execute process '%s': the size of argument and " diff --git a/src/screen.cpp b/src/screen.cpp index 45fe5bda8..5bb5d0a82 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -309,7 +309,7 @@ static size_t measure_run_from(const wchar_t *input, size_t start, size_t *out_e layout_cache_t &cache) { size_t width = 0; size_t idx = start; - for (idx = start; !is_run_terminator(input[idx]); idx++) { + for (; !is_run_terminator(input[idx]); idx++) { if (input[idx] == L'\x1B') { // This is the start of an escape code; we assume it has width 0. // -1 because we are going to increment in the loop.