From e67e511e00b98d639343ad38244d30d1b9cd6cf4 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 3 Mar 2017 13:55:31 +0000 Subject: remove a few redundant conditions that jsg@ found with cppcheck --- man.c | 4 ++-- mdoc.c | 4 ++-- mdoc_html.c | 4 ++-- roff.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/man.c b/man.c index a2db05fb..aea3872e 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.167 2017/01/10 13:47:00 schwarze Exp $ */ +/* $Id: man.c,v 1.168 2017/03/03 13:55:31 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015 Ingo Schwarze @@ -203,7 +203,7 @@ man_pmacro(struct roff_man *man, int ln, char *buf, int offs) /* Jump to the next non-whitespace word. */ - while (buf[offs] && buf[offs] == ' ') + while (buf[offs] == ' ') offs++; /* diff --git a/mdoc.c b/mdoc.c index 5be1e781..ccd66272 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.260 2017/02/16 03:00:23 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.261 2017/03/03 13:55:31 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2017 Ingo Schwarze @@ -382,7 +382,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs) /* Jump to the next non-whitespace word. */ - while (buf[offs] && ' ' == buf[offs]) + while (buf[offs] == ' ') offs++; /* diff --git a/mdoc_html.c b/mdoc_html.c index d3b63b96..81e753a8 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.272 2017/02/22 08:54:41 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.273 2017/03/03 13:55:31 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -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; diff --git a/roff.c b/roff.c index a6f27040..d91c9c2b 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.290 2017/03/03 11:50:49 schwarze Exp $ */ +/* $Id: roff.c,v 1.291 2017/03/03 13:55:32 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -1608,7 +1608,7 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs) 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); } -- cgit v1.2.3