From 88b4db0c5006145ab082d5b6fe91e1109c088c5c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 25 Jul 2015 11:07:38 +0100 Subject: [PATCH] Add a commentary assertion in config dialog setup. Coverity complained that some paths through the loop in the WM_INITDIALOG handler might leave firstpath==NULL. In fact this can't happen because the input data to that loop is largely static and we know what it looks like, but it doesn't seem unreasonable to add an assertion anyway, to keep static checkers happy and as an explanatory quasi-comment for humans. --- windows/windlg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/windows/windlg.c b/windows/windlg.c index 5bedd130..78311616 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -505,6 +505,7 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg, * And create the actual control set for that panel, to * match the initial treeview selection. */ + assert(firstpath); /* config.c must have given us _something_ */ create_controls(hwnd, firstpath); dlg_refresh(NULL, &dp); /* and set up control values */ }