summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-03-03 13:55:07 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-03-03 13:55:07 +0000
commit186405727436351054e1d240e68a7df1c49dfce0 (patch)
tree8ebac6177fdf46fff9d7fa99314dd48e698665eb /usr.bin/mandoc
parentdcbc6fca6a5cddbad90f3256cf9ecad2b40b4d42 (diff)
remove a few redundant conditions that jsg@ found with cppcheck
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/man.c4
-rw-r--r--usr.bin/mandoc/mdoc.c4
-rw-r--r--usr.bin/mandoc/mdoc_html.c4
-rw-r--r--usr.bin/mandoc/roff.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c
index dd0c0c341f8..8d99982e7cd 100644
--- a/usr.bin/mandoc/man.c
+++ b/usr.bin/mandoc/man.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man.c,v 1.115 2017/01/10 13:46:53 schwarze Exp $ */
+/* $OpenBSD: man.c,v 1.116 2017/03/03 13:55:06 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -201,7 +201,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/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index a5858e15d37..db9918e892b 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc.c,v 1.149 2017/02/16 02:59:42 schwarze Exp $ */
+/* $OpenBSD: mdoc.c,v 1.150 2017/03/03 13:55:06 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -380,7 +380,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/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 963fa66e23e..08673ebb35a 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.147 2017/02/22 08:52:24 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.148 2017/03/03 13:55:06 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -664,7 +664,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/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index a61af8a1022..94428d9d192 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: roff.c,v 1.162 2017/03/03 11:49:33 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.163 2017/03/03 13:55:06 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1606,7 +1606,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);
}