tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: "Ulrich Spörlein" <uqs@spoerlein.net>
To: tech@mdocml.bsd.lv
Subject: [patch] remove dead code
Date: Fri, 17 May 2013 03:00:50 +0200	[thread overview]
Message-ID: <20130517010050.GY2055@acme.spoerlein.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

Hey,

please see the following patch which removes a bit of dead code. With sz
being invariant 0, the loop will never do anything.

This is Coverity Scan CID 975717

Cheers,
Uli

[-- Attachment #2: tree.diff --]
[-- Type: text/x-diff, Size: 737 bytes --]

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);
 	}
 

             reply	other threads:[~2013-05-17  1:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  1:00 Ulrich Spörlein [this message]
2013-05-18 17:12 ` Ingo Schwarze
2013-05-18 19:21   ` Ulrich Spörlein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130517010050.GY2055@acme.spoerlein.net \
    --to=uqs@spoerlein.net \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).