From 2e7ca448ae340392f3e15cdceaed02c3419edbc2 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Mon, 16 Jun 2014 20:15:18 +0200 Subject: [PATCH] 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 --- util/wmmenugen.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/util/wmmenugen.c b/util/wmmenugen.c index 2348769b..47771f56 100644 --- a/util/wmmenugen.c +++ b/util/wmmenugen.c @@ -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); }