From d58060378efacd93ee0ca21f9b518e5d81b4578a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 22 Nov 2022 22:43:46 +0200 Subject: [PATCH 14/14] sdl2: Fix clang analyzer NULL dereference warning From unit_select_dialog_popup() See osdn #46099 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/dialogs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/gui-sdl2/dialogs.c b/client/gui-sdl2/dialogs.c index a11af3ef25..c7cec89352 100644 --- a/client/gui-sdl2/dialogs.c +++ b/client/gui-sdl2/dialogs.c @@ -1083,7 +1083,7 @@ void unit_select_dialog_popup(struct tile *ptile) n = unit_list_size(ptile->units); - if (!n || pUnit_Select_Dlg) { + if (n == 0 || pUnit_Select_Dlg) { return; } @@ -1193,7 +1193,7 @@ void unit_select_dialog_popup(struct tile *ptile) area = pWindow->area; put_window_near_map_tile(pWindow, pWindow->size.w, pWindow->size.h, - unit_tile(pUnit)); + ptile); w = area.w; -- 2.35.1