1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Coverity: fix WPrefs workspace negative array index read

This commit is contained in:
David Maciejak
2023-03-03 13:36:04 +08:00
committed by Carlos R. Mafra
parent 7475bc5d0a
commit d4ee17f0b5

View File

@@ -207,12 +207,15 @@ static void createPanel(Panel * p)
static void storeData(_Panel * panel)
{
int tmp = WMGetPopUpButtonSelectedItem(panel->posP);
if (tmp < 0)
return;
SetBoolForKey(!WMGetButtonSelected(panel->linkB), "DontLinkWorkspaces");
SetBoolForKey(WMGetButtonSelected(panel->cyclB), "CycleWorkspaces");
SetBoolForKey(WMGetButtonSelected(panel->newB), "AdvanceToNewWorkspace");
SetStringForKey(WSNamePositions[WMGetPopUpButtonSelectedItem(panel->posP)],
"WorkspaceNameDisplayPosition");
SetStringForKey(WSNamePositions[tmp], "WorkspaceNameDisplayPosition");
}
Panel *InitWorkspace(WMWidget *parent)