X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/d53f3eea978ab62538513a30e29ca8c1da6f9c45..1969953cea0d27525c0c0b227d2021bd99952969:/validate.c diff --git a/validate.c b/validate.c index 2ebd427d..9fbc4058 100644 --- a/validate.c +++ b/validate.c @@ -1,4 +1,4 @@ -/* $Id: validate.c,v 1.72 2009/03/08 11:48:44 kristaps Exp $ */ +/* $Id: validate.c,v 1.73 2009/03/08 12:40:27 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -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")); }