diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-22 08:56:16 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-22 08:56:16 +0000 |
commit | de2f1180552ba0141ccf20dd2a4665ee6a724d7e (patch) | |
tree | d48e2ed5490a5787512415cbb95960db91621fe0 | |
parent | 422eea354d16149a590fff2c9822f4dbde0e4bfa (diff) | |
download | mandoc-de2f1180552ba0141ccf20dd2a4665ee6a724d7e.tar.gz |
Added check for graphable characters in initial-line parse for libman and libmdoc (joerg@netbsd.org).
-rw-r--r-- | man.c | 6 | ||||
-rw-r--r-- | mdoc.c | 6 |
2 files changed, 12 insertions, 0 deletions
@@ -493,6 +493,12 @@ man_pmacro(struct man *m, int ln, char *buf) break; else if (' ' == buf[i]) break; + + /* Check for invalid characters. */ + + if (isgraph((u_char)buf[i])) + continue; + return(man_perr(m, ln, i, WNPRINT)); } mac[j] = 0; @@ -709,6 +709,12 @@ parsemacro(struct mdoc *m, int ln, char *buf) break; else if (' ' == buf[i]) break; + + /* Check for invalid characters. */ + + if (isgraph((u_char)buf[i])) + continue; + return(mdoc_perr(m, ln, i, EPRINT)); } mac[j] = 0; |