From 23c3101440684f87f49420d1ef664b868fb86d69 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Thu, 3 Nov 2016 16:53:58 -0700 Subject: [PATCH] lint: goto and dead code --- src/builtin_printf.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/builtin_printf.cpp b/src/builtin_printf.cpp index e2d2d14ad..645dd982b 100644 --- a/src/builtin_printf.cpp +++ b/src/builtin_printf.cpp @@ -597,8 +597,7 @@ int builtin_printf_state_t::print_formatted(const wchar_t *format, int argc, wch } modify_allowed_format_specifiers(ok, "aAcdeEfFgGiosuxX", true); - - for (;; f++, direc_length++) { + for (bool continue_looking_for_flags = true; continue_looking_for_flags;) { switch (*f) { case L'I': case L'\'': { @@ -619,12 +618,15 @@ int builtin_printf_state_t::print_formatted(const wchar_t *format, int argc, wch break; } default: { - goto no_more_flag_characters; + continue_looking_for_flags = false; break; } } + if (continue_looking_for_flags) { + f++; + direc_length++; + } } - no_more_flag_characters:; if (*f == L'*') { ++f;