mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +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 */
|
} else { /* plain simple command */
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
if (wm->Flags & F_TERMINAL) /* XXX: quoting! */
|
if (wm->Flags & F_TERMINAL) /* XXX: quoting! */
|
||||||
snprintf(buf, sizeof(buf), "%s -e \"%s\"", terminal, wm->CmdLine);
|
snprintf(buf, sizeof(buf), "%s -e \"%s\"", terminal, wm->CmdLine);
|
||||||
else
|
else
|
||||||
snprintf(buf, sizeof(buf), "%s", wm->CmdLine);
|
snprintf(buf, sizeof(buf), "%s", wm->CmdLine);
|
||||||
WMAddToPLArray(pl, WMCreatePLArray(
|
|
||||||
WMCreatePLString(wm->Name),
|
WMAddToPLArray(pl, WMCreatePLArray(
|
||||||
WMCreatePLString("SHEXEC"),
|
WMCreatePLString(wm->Name),
|
||||||
WMCreatePLString(buf),
|
WMCreatePLString("SHEXEC"),
|
||||||
NULL)
|
WMCreatePLString(buf),
|
||||||
);
|
NULL)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
WMAddToArray(plMenuNodes, pl);
|
WMAddToArray(plMenuNodes, pl);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user