From 558c57a086c3029f7828c7956c6412136bbba431 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 30 Apr 2024 11:00:57 +0200 Subject: [PATCH] Fixed static analyzer warning "Pointer to local array 'overlay_buf' is stored outside the scope". Technically not used outside that scope, but best to play nice. --- imgui_widgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 224350819..b5ee9ba5a 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -1316,9 +1316,9 @@ void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* over // Default displaying the fraction as percentage string, but user can override it // Don't display text for indeterminate bars by default + char overlay_buf[32]; if (!is_indeterminate || overlay != NULL) { - char overlay_buf[32]; if (!overlay) { ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction * 100 + 0.01f);