From patchwork Sun Jan 22 13:22:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 1465 Return-Path: Received: from nick.hrz.tu-chemnitz.de (nick.hrz.tu-chemnitz.de [134.109.228.11]) by open-mesh.org (Postfix) with ESMTPS id 3780E600735 for ; Sun, 22 Jan 2012 14:22:12 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@tu-chemnitz.de; dkim-adsp=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Message-Id:Date:Subject:To:From; bh=s0h7ggjuaECnp/a/2ReUm4ToScj64IOj3TcU0VSzhJw=; b=WAyOUqZiOUDDSAKnVTfS+lJtEslraeu1nLX36QEDZik8Hy0YiQH0n0HrrK2ZgvTY/I0tuQpSGImfBysgf5bpW8J9AjZERSEy5WdtTiOuXOtfKdTtIM4FuRMoNvkoGtApFyao1cGV2MsiL1AXJmcOCk6Yhi0QFRv7Mf87O0szQKQ=; Received: from p57aa022b.dip0.t-ipconnect.de ([87.170.2.43] helo=pandem0nium) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RoxN5-000336-M6 for b.a.t.m.a.n@lists.open-mesh.org; Sun, 22 Jan 2012 14:22:11 +0100 Received: from dotslash by pandem0nium with local (Exim 4.72) (envelope-from ) id 1RoxN6-0002CY-Du for b.a.t.m.a.n@lists.open-mesh.org; Sun, 22 Jan 2012 14:22:12 +0100 From: Simon Wunderlich To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 22 Jan 2012 14:22:12 +0100 Message-Id: <1327238532-8433-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.2.5 X-RBL-Warning: 87.170.2.43 is listed at zen.spamhaus.org X-Scan-AV: nick.hrz.tu-chemnitz.de; 2012-01-22 14:22:11; 3ef7e60ea8631cb7b6b9ba4a32726541 X-Scan-SA: nick.hrz.tu-chemnitz.de; 2012-01-22 14:22:11; 3ad3a3eaaeb16bcff8c4e923223329ef X-Spam-Score: 1.5 (+) X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (1.5 Punkte) Fragen an/questions to: Postmaster TU Chemnitz * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 2.5 TUC_RBL RBL: Mail von bekanntem Spam-Relay oder Dialup (TUC) --- Ende Textanalyse Subject: [B.A.T.M.A.N.] [PATCH] batctl: exit on parse error in batctl ll X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 13:22:12 -0000 If the argument could not be understood, we should not try to apply something, but return from the function. Signed-off-by: Simon Wunderlich --- sys.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/sys.c b/sys.c index 9cdccba..ab7d75f 100644 --- a/sys.c +++ b/sys.c @@ -221,8 +221,11 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) log_level |= (1 << 1); else if (strcmp(argv[i], "tt") == 0) log_level |= (1 << 2); - else + else { log_level_usage(); + free(path_buff); + return EXIT_FAILURE; + } } snprintf(str, sizeof(str), "%i", log_level);