mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
util: fix misleading indentation in assemblePLMenuFunc (Coverity #50094)
As pointed by Coverity, the indentation for a block of code could lead to misinterpretation on when it is executed. To make code safer, re-indented the code properly and added some blank lines for clarity. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
b5e2821c3e
commit
2e7ca448ae
@@ -239,17 +239,19 @@ static void assemblePLMenuFunc(WMTreeNode *aNode, void *data)
|
||||
);
|
||||
} else { /* plain simple command */
|
||||
char buf[1024];
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
if (wm->Flags & F_TERMINAL) /* XXX: quoting! */
|
||||
snprintf(buf, sizeof(buf), "%s -e \"%s\"", terminal, wm->CmdLine);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s", wm->CmdLine);
|
||||
WMAddToPLArray(pl, WMCreatePLArray(
|
||||
WMCreatePLString(wm->Name),
|
||||
WMCreatePLString("SHEXEC"),
|
||||
WMCreatePLString(buf),
|
||||
NULL)
|
||||
);
|
||||
|
||||
WMAddToPLArray(pl, WMCreatePLArray(
|
||||
WMCreatePLString(wm->Name),
|
||||
WMCreatePLString("SHEXEC"),
|
||||
WMCreatePLString(buf),
|
||||
NULL)
|
||||
);
|
||||
}
|
||||
WMAddToArray(plMenuNodes, pl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user