summaryrefslogtreecommitdiffstatshomepage
path: root/man.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-22 08:56:16 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-22 08:56:16 +0000
commit4569d232fe6387ebaffede22a904a733d699030f (patch)
treee69803f379ab2e78e77b8c61b4518e386d9aca2b /man.c
parent115a33d8b5b4a3cc8361aceda5ad0503ae4d6e42 (diff)
downloadmandoc-4569d232fe6387ebaffede22a904a733d699030f.tar.gz
mandoc-4569d232fe6387ebaffede22a904a733d699030f.tar.zst
mandoc-4569d232fe6387ebaffede22a904a733d699030f.zip
Added check for graphable characters in initial-line parse for libman and libmdoc (joerg@netbsd.org).
Diffstat (limited to 'man.c')
-rw-r--r--man.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/man.c b/man.c
index 8fcb8ef9..c503a937 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.37 2009/08/21 13:45:33 kristaps Exp $ */
+/* $Id: man.c,v 1.38 2009/08/22 08:56:16 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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;