From patchwork Sun Jan 22 18:31:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 1451 Return-Path: Received: from cora.hrz.tu-chemnitz.de (cora.hrz.tu-chemnitz.de [134.109.228.40]) by open-mesh.org (Postfix) with ESMTPS id EBCC9600810 for ; Sun, 22 Jan 2012 19:31:02 +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=References:In-Reply-To:Message-Id:Date:Subject:To:From; bh=3FtXfWEeC0bSPAxoa0qk4mediHpiK3s7uhdZoz3lvLM=; b=ihTpxXTTKlAdrzEzZ4rhwfYhOBSTYZybZs2qXRq9KCTGOz1GJRa4jNmNtLYcDgv2Xm5l/TzwYv8M8JBOM/Oiq8J6WPBG1i3vinUwLTegw6yEaocsFQYf9UhhnbABLgpKQoCwaKwY20YwBKDzwPSugGMN0YI2Twem2fNc7J2aHgs=; Received: from p57aa022b.dip0.t-ipconnect.de ([87.170.2.43] helo=pandem0nium) by cora.hrz.tu-chemnitz.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Rp2By-0007BU-EQ for b.a.t.m.a.n@lists.open-mesh.org; Sun, 22 Jan 2012 19:31:02 +0100 Received: from dotslash by pandem0nium with local (Exim 4.72) (envelope-from ) id 1Rp2Bz-0003Sw-KS for b.a.t.m.a.n@lists.open-mesh.org; Sun, 22 Jan 2012 19:31:03 +0100 From: Simon Wunderlich To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 22 Jan 2012 19:31:03 +0100 Message-Id: <1327257063-13289-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <201201222146.51275.lindner_marek@yahoo.de> References: <201201222146.51275.lindner_marek@yahoo.de> X-RBL-Warning: 87.170.2.43 is listed at zen.spamhaus.org X-Scan-AV: cora.hrz.tu-chemnitz.de; 2012-01-22 19:31:02; a6f7ede2029617f05cdf2a55bf3dda14 X-Scan-SA: cora.hrz.tu-chemnitz.de; 2012-01-22 19:31:02; 31704afa4ef808a729fc0046173e3c95 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.] [PATCHv2] 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 18:31:03 -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..56f55dd 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(); + res = EXIT_FAILURE; + goto out; + } } snprintf(str, sizeof(str), "%i", log_level);