summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-25 16:03:03 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-25 16:03:03 +0000
commit4690a796b3a9cd2ed9769323c29d5e442d4be21f (patch)
treeb1b4f7e79c008f6af9c8283d26cd23ad27528079
parent1dc71205dae2e5dd56cf1f23033d63c7e14a0795 (diff)
downloadmandoc-4690a796b3a9cd2ed9769323c29d5e442d4be21f.tar.gz
mandoc-4690a796b3a9cd2ed9769323c29d5e442d4be21f.tar.zst
mandoc-4690a796b3a9cd2ed9769323c29d5e442d4be21f.zip
Patches and results of LLVM static analysis (thanks uqs@sporlein.net).
-rw-r--r--mdoc_action.c3
-rw-r--r--mdoc_macro.c11
-rw-r--r--mdoc_term.c3
-rw-r--r--mdoc_validate.c3
4 files changed, 10 insertions, 10 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index a45faf9c..a5e84dfd 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_action.c,v 1.32 2009/07/24 13:18:15 kristaps Exp $ */
+/* $Id: mdoc_action.c,v 1.33 2009/07/25 16:03:03 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -487,7 +487,6 @@ post_dt(POST_ARGS)
free(m->meta.vol);
if (NULL == (m->meta.vol = strdup(cp)))
return(mdoc_nerr(m, m->last, EMALLOC));
- n = n->next;
} else {
cp = mdoc_a2arch(n->string);
if (NULL == cp) {
diff --git a/mdoc_macro.c b/mdoc_macro.c
index b156f0bd..97b157be 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.26 2009/07/24 12:17:25 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.27 2009/07/25 16:03:03 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -681,7 +681,7 @@ blk_exp_close(MACRO_PROT_ARGS)
mdoc->next = MDOC_NEXT_CHILD;
}
- for (lastarg = ppos, flushed = j = 0; ; j++) {
+ for (flushed = j = 0; ; j++) {
lastarg = *pos;
if (j == maxargs && ! flushed) {
@@ -760,7 +760,7 @@ in_line(MACRO_PROT_ARGS)
break;
}
- for (la = ppos, arg = NULL;; ) {
+ for (arg = NULL;; ) {
la = *pos;
c = mdoc_argv(mdoc, line, tok, &arg, pos, buf);
@@ -1046,7 +1046,7 @@ blk_part_imp(MACRO_PROT_ARGS)
/* XXX - no known argument macros. */
- for (lastarg = ppos;; ) {
+ for (;;) {
lastarg = *pos;
c = mdoc_args(mdoc, line, pos, buf, tok, &p);
assert(ARGS_PHRASE != c);
@@ -1107,7 +1107,6 @@ blk_part_exp(MACRO_PROT_ARGS)
int lastarg, flushed, j, c, maxargs;
char *p;
- lastarg = ppos;
flushed = 0;
/*
@@ -1243,7 +1242,7 @@ in_line_argn(MACRO_PROT_ARGS)
break;
}
- for (lastarg = ppos, arg = NULL;; ) {
+ for (arg = NULL;; ) {
lastarg = *pos;
c = mdoc_argv(mdoc, line, tok, &arg, pos, buf);
diff --git a/mdoc_term.c b/mdoc_term.c
index 0a4ee37c..e805bce5 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.62 2009/07/24 12:52:28 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.63 2009/07/25 16:03:03 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -674,6 +674,7 @@ fmt_block_vspace(struct termp *p,
if (MDOC_Bl == bl->tok && arg_hasattr(MDOC_Compact, bl))
return;
+ assert(node);
/*
* Search through our prior nodes. If we follow a `Ss' or `Sh',
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 9d043526..1b04ccc7 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.40 2009/07/24 12:09:37 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.41 2009/07/25 16:03:03 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1219,6 +1219,7 @@ post_sh_body(POST_ARGS)
return(0);
}
+ assert(n);
if (MDOC_BLOCK == n->type && MDOC_Nd == n->tok)
return(1);
return(mdoc_nwarn(mdoc, mdoc->last, ENAMESECINC));