From 7d2d2c97b246b1d1ea4d530159b84f07552606f1 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 19 Jul 2020 16:51:11 -0700 Subject: [PATCH] Fix a compiler warning in builtin_printf --- src/builtin_printf.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/builtin_printf.cpp b/src/builtin_printf.cpp index b57896712..834fbc178 100644 --- a/src/builtin_printf.cpp +++ b/src/builtin_printf.cpp @@ -714,8 +714,13 @@ int builtin_printf_state_t::print_formatted(const wchar_t *format, int argc, wch return 0; } + const wchar_t *argument = L""; + if (argc > 0) { + argument = *argv++; + argc--; + } print_direc(direc_start, direc_length, *f, have_field_width, field_width, - have_precision, precision, (argc <= 0 ? L"" : (argc--, *argv++))); + have_precision, precision, argument); break; } case L'\\': {