From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout.scc.kit.edu (mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id r4IHC7PY013757 for ; Sat, 18 May 2013 13:12:07 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1Udkfv-0004uT-6b; Sat, 18 May 2013 19:12:07 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1Udkfv-0008G7-8g; Sat, 18 May 2013 19:12:07 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1Udkfv-0003p0-7D; Sat, 18 May 2013 19:12:07 +0200 Received: from schwarze by usta.de with local (Exim 4.77) (envelope-from ) id 1Udkfv-0005VC-6X; Sat, 18 May 2013 19:12:07 +0200 Date: Sat, 18 May 2013 19:12:07 +0200 From: Ingo Schwarze To: tech@mdocml.bsd.lv Cc: uqs@spoerlein.net Subject: Re: [patch] remove dead code Message-ID: <20130518171207.GA13985@iris.usta.de> References: <20130517010050.GY2055@acme.spoerlein.net> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20130517010050.GY2055@acme.spoerlein.net> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Ulrich, Ulrich Spörlein wrote on Fri, May 17, 2013 at 03:00:50AM +0200: > please see the following patch which removes a bit of dead code. > With sz being invariant 0, the loop will never do anything. Right, committed to both bsd.lv and openbsd.org. > This is Coverity Scan CID 975717 Strangly enough, it seems that Coverity missed that **params is unused as well. Anyway, i removed **params, too. Thanks, Ingo > Index: tree.c > =================================================================== > RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tree.c,v > retrieving revision 1.47 > diff -u -p -r1.47 tree.c > --- tree.c 18 Sep 2011 14:14:15 -0000 1.47 > +++ tree.c 17 May 2013 00:42:33 -0000 > @@ -58,12 +58,12 @@ print_mdoc(const struct mdoc_node *n, in > { > const char *p, *t; > int i, j; > - size_t argc, sz; > + size_t argc; > char **params; > struct mdoc_argv *argv; > > argv = NULL; > - argc = sz = 0; > + argc = 0; > params = NULL; > t = p = NULL; > > @@ -162,9 +162,6 @@ print_mdoc(const struct mdoc_node *n, in > printf(" ]"); > } > > - for (i = 0; i < (int)sz; i++) > - printf(" [%s]", params[i]); > - > printf(" %d:%d\n", n->line, n->pos); > } > -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv