From patchwork Tue Nov 23 12:13:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 604 Return-Path: Received: from rubicon.hasler.ascom.ch (rubicon.hasler.ascom.ch [139.79.129.1]) by open-mesh.org (Postfix) with ESMTPS id F36FF15456C for ; Tue, 23 Nov 2010 13:13:23 +0100 (CET) Received: from eiger.ma.tech.ascom.ch (eiger.ma.tech.ascom.ch [139.79.100.1]) by rubicon.hasler.ascom.ch (8.14.4/8.14.4) with ESMTP id oANCDNex024251; Tue, 23 Nov 2010 13:13:23 +0100 (MET) Received: from [139.79.100.62] (helo=localhost) by eiger.ma.tech.ascom.ch with esmtp (Exim 3.16 #1) id 1PKrkP-0001zy-00; Tue, 23 Nov 2010 13:13:21 +0100 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 23 Nov 2010 13:13:19 +0100 Message-Id: <1290514400-6887-3-git-send-email-linus.luessing@ascom.ch> X-Mailer: git-send-email 1.7.1 In-Reply-To: <201011230044.58352.lindner_marek@yahoo.de> References: <201011230044.58352.lindner_marek@yahoo.de> MIME-Version: 1.0 Cc: =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [B.A.T.M.A.N.] [PATCHv2 2/3] batctl: Fix skipped substitutions of mac addresses with a following ', ' X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 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: Tue, 23 Nov 2010 12:13:24 -0000 When batctl does not find a matching name for a given mac address in the bat-hosts file, then it unfortunately removes the following ',' instead of leaving the string unmodified. batctl bisect is then not able to find the mac address anymore. This commit fixes this issue. Signed-off-by: Linus Lüssing --- functions.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions.c b/functions.c index ce046ba..9b1e22b 100644 --- a/functions.c +++ b/functions.c @@ -201,16 +201,16 @@ read: /* keep table format */ printf("%17s", bat_host->name); - if (extra_char != '\0') - printf("%c", extra_char); - - printf(" "); goto written; print_plain_buff: - printf("%s ", buff_ptr); + printf("%s", buff_ptr); written: + if (extra_char != '\0') + printf("%c", extra_char); + + printf(" "); buff_ptr = space_ptr + 1; }