diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | mdoc.c | 4 | ||||
-rw-r--r-- | mmain.c | 9 |
3 files changed, 8 insertions, 7 deletions
@@ -1,6 +1,6 @@ .SUFFIXES: .html .sgml -VERSION = 1.4.5 +VERSION = 1.4.6 VDATE = 9 March 2009 BINDIR = $(PREFIX)/bin @@ -501,10 +501,10 @@ macrowarn(struct mdoc *m, int ln, const char *buf) { if ( ! (MDOC_IGN_MACRO & m->pflags)) return(mdoc_perr(m, ln, 1, "unknown macro: %s%s", - buf, buf[3] ? "..." : "")); + buf, strlen(buf) > 3 ? "..." : "")); return(mdoc_pwarn(m, ln, 1, WARN_SYNTAX, "unknown macro: %s%s", - buf, buf[3] ? "..." : "")); + buf, strlen(buf) > 3 ? "..." : "")); } @@ -312,18 +312,19 @@ parse(struct mmain *p) } ln[pos] = 0; - if ( ! mdoc_parseln(p->mdoc, lnn, ln)) + if ( ! mdoc_parseln(p->mdoc, lnn, ln)) { + free(ln); return(0); + } lnn++; pos = 0; } } - if (pos > 0) - warnx("%s: file not eof-terminated", p->in); - if (ln) free(ln); + if (pos > 0) + warnx("%s: file not eof-terminated", p->in); return(mdoc_endparse(p->mdoc)); } |