aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-10-16 12:20:34 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-10-16 12:20:34 +0000
commit5a614b48d4e480e6aecbb9f6257de42dee05e3ae (patch)
treec5f20936909655fb1afd3ac71a4670c9b4d1fb91 /man_validate.c
parent69a8c4eeef220e21f890c4afe5039fe26bb0249d (diff)
downloadmandoc-5a614b48d4e480e6aecbb9f6257de42dee05e3ae.tar.gz
mandoc-5a614b48d4e480e6aecbb9f6257de42dee05e3ae.tar.zst
mandoc-5a614b48d4e480e6aecbb9f6257de42dee05e3ae.zip
Remove a bunch of useless assignments,
and assert that print_bvspace cannot be called on NULL pointers. No change in behaviour, none of these were bugs, but the code becomes easier to understand. Based on a clang report posted by joerg@; ok kristaps@.
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/man_validate.c b/man_validate.c
index 3a178e65..28352a0c 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.75 2011/09/06 17:53:50 kristaps Exp $ */
+/* $Id: man_validate.c,v 1.76 2011/10/16 12:20:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -213,12 +213,12 @@ check_text(CHKARGS)
{
char *cp, *p;
- cp = p = n->string;
- for (cp = p; NULL != (p = strchr(p, '\t')); p++) {
- if (MAN_LITERAL & m->flags)
- continue;
+ if (MAN_LITERAL & m->flags)
+ return;
+
+ cp = n->string;
+ for (p = cp; NULL != (p = strchr(p, '\t')); p++)
man_pmsg(m, n->line, (int)(p - cp), MANDOCERR_BADTAB);
- }
}
#define INEQ_DEFINE(x, ineq, name) \
@@ -474,7 +474,6 @@ post_UC(CHKARGS)
const char *p, *s;
n = n->child;
- n = m->last->child;
if (NULL == n || MAN_TEXT != n->type)
p = bsd_versions[0];