1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 22:52:34 +01:00

Remove useless NULL test

If menu is NULL we would have a null pointer dereference when initializing scr.

> Ie, why not move the assignment of 'src' to after the test?

I thought about this, but I checked the 3 different calls to
updateWorkspaceMenu (all in winmenu.c). They must all call
updateWorkspaceMenu with non-NULL pointers, so if we have a NULL
'menu' pointer then we obviously have a major problem and it is
probably better to crash here than to silently return and fail a
little latter.

[crmafra: edit changelog]
This commit is contained in:
Nicolas Bonifas
2009-12-06 02:19:20 +01:00
committed by Carlos R. Mafra
parent 391d5de79e
commit a2cb317f11

View File

@@ -215,9 +215,6 @@ static void updateWorkspaceMenu(WMenu * menu)
char title[MAX_WORKSPACENAME_WIDTH + 1];
int i;
if (!menu)
return;
for (i = 0; i < scr->workspace_count; i++) {
if (i < menu->entry_no) {
if (strcmp(menu->entries[i]->text, scr->workspaces[i]->name) != 0) {