summaryrefslogtreecommitdiffstats
path: root/mdoc_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
commit855d59ab582ff06a37b6864586bd5d5aa61018a2 (patch)
treeec50e0edd6a8458edd410b827c40dbf7d4a7b786 /mdoc_validate.c
parent14297a71223fc5ff079a17f339ddbf603eaca3bf (diff)
downloadmandoc-855d59ab582ff06a37b6864586bd5d5aa61018a2.tar.gz
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 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index d9d3b4d9..09f91873 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -545,12 +545,11 @@ check_text(struct mdoc *m, int ln, int pos, char *p)
{
char *cp;
- cp = p;
- for (cp = p; NULL != (p = strchr(p, '\t')); p++) {
- if (MDOC_LITERAL & m->flags)
- continue;
+ if (MDOC_LITERAL & m->flags)
+ return;
+
+ for (cp = p; NULL != (p = strchr(p, '\t')); p++)
mdoc_pmsg(m, ln, pos + (int)(p - cp), MANDOCERR_BADTAB);
- }
}
static int