summaryrefslogtreecommitdiffstats
path: root/validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 12:40:27 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 12:40:27 +0000
commit74e270cb031a950090a2f9a9c1a083e2c45ebb6a (patch)
tree9227d21db7c9d0ba4e9a907977f4ceb68a7f546f /validate.c
parentca7eb2795830f918afc855b2fdaabe093d8cee13 (diff)
downloadmandoc-74e270cb031a950090a2f9a9c1a083e2c45ebb6a.tar.gz
Memory fixes in new dynamic schema.
Diffstat (limited to 'validate.c')
-rw-r--r--validate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/validate.c b/validate.c
index f61e1fe7..271e8e49 100644
--- a/validate.c
+++ b/validate.c
@@ -638,6 +638,7 @@ check_args(struct mdoc *m, const struct mdoc_node *n)
if (NULL == n->args)
return(1);
+ assert(n->args->argc);
for (i = 0; i < (int)n->args->argc; i++)
if ( ! check_argv(m, n, &n->args->argv[i]))
return(0);
@@ -684,8 +685,7 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p)
p += (int)c - 1;
continue;
}
- return(mdoc_perr(mdoc, line, pos,
- "invalid escape sequence: %s", p));
+ return(mdoc_perr(mdoc, line, pos, "invalid escape"));
}
return(1);
@@ -891,7 +891,7 @@ static int
pre_an(PRE_ARGS)
{
- if (n->args && 1 >= n->args->argc)
+ if (NULL == n->args || 1 == n->args->argc)
return(1);
return(mdoc_nerr(mdoc, n, "only one argument allowed"));
}