From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id e3995655 for ; Fri, 3 Mar 2017 08:56:02 -0500 (EST) Date: Fri, 3 Mar 2017 08:56:02 -0500 (EST) Message-Id: <989226450587718931.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: remove a few redundant conditions that jsg@ found with cppcheck X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- remove a few redundant conditions that jsg@ found with cppcheck Modified Files: -------------- mdocml: man.c mdoc.c mdoc_html.c roff.c Revision Data ------------- Index: mdoc_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v retrieving revision 1.272 retrieving revision 1.273 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.272 -r1.273 --- mdoc_html.c +++ mdoc_html.c @@ -666,7 +666,7 @@ mdoc_it_pre(MDOC_ARGS) enum mdoc_list type; bl = n->parent; - while (bl != NULL && bl->tok != MDOC_Bl) + while (bl->tok != MDOC_Bl) bl = bl->parent; type = bl->norm->Bl.type; Index: man.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/man.c,v retrieving revision 1.167 retrieving revision 1.168 diff -Lman.c -Lman.c -u -p -r1.167 -r1.168 --- man.c +++ man.c @@ -203,7 +203,7 @@ man_pmacro(struct roff_man *man, int ln, /* Jump to the next non-whitespace word. */ - while (buf[offs] && buf[offs] == ' ') + while (buf[offs] == ' ') offs++; /* Index: mdoc.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc.c,v retrieving revision 1.260 retrieving revision 1.261 diff -Lmdoc.c -Lmdoc.c -u -p -r1.260 -r1.261 --- mdoc.c +++ mdoc.c @@ -382,7 +382,7 @@ mdoc_pmacro(struct roff_man *mdoc, int l /* Jump to the next non-whitespace word. */ - while (buf[offs] && ' ' == buf[offs]) + while (buf[offs] == ' ') offs++; /* Index: roff.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/roff.c,v retrieving revision 1.290 retrieving revision 1.291 diff -Lroff.c -Lroff.c -u -p -r1.290 -r1.291 --- roff.c +++ roff.c @@ -1608,7 +1608,7 @@ roff_parseln(struct roff *r, int ln, str return ROFF_IGN; while (buf->buf[pos] != '\0' && buf->buf[pos] != ' ') pos++; - while (buf->buf[pos] != '\0' && buf->buf[pos] == ' ') + while (buf->buf[pos] == ' ') pos++; return tbl_read(r->tbl, ln, buf->buf, pos); } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv