summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2022-04-24 13:34:54 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2022-04-24 13:34:54 +0000
commit04d198e5b66cf644f9fbb2ac1d70f4498d13b6c3 (patch)
tree03e1a12597089f9ee2c3cde84249428c0382572c /usr.bin/mandoc/mandoc.h
parent55c1309fa3a9c1f4e5a4acad95f6ed6dd4da35d3 (diff)
If a .shift request has a negative argument, do not use a negative array
index but use 0 instead of the argument, just like groff. Warn about the invalid argument. While here, fix the column number in another warning message. Segfault reported by tb@, found with afl(1).
Diffstat (limited to 'usr.bin/mandoc/mandoc.h')
-rw-r--r--usr.bin/mandoc/mandoc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h
index c23d2285421..8f98470e9cb 100644
--- a/usr.bin/mandoc/mandoc.h
+++ b/usr.bin/mandoc/mandoc.h
@@ -1,6 +1,6 @@
-/* $OpenBSD: mandoc.h,v 1.216 2021/08/14 13:51:46 schwarze Exp $ */
+/* $OpenBSD: mandoc.h,v 1.217 2022/04/24 13:34:53 schwarze Exp $ */
/*
- * Copyright (c) 2012-2021 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012-2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -215,6 +215,7 @@ enum mandocerr {
MANDOCERR_NAMESC, /* escaped character not allowed in a name: name */
MANDOCERR_ARG_UNDEF, /* using macro argument outside macro */
MANDOCERR_ARG_NONUM, /* argument number is not numeric */
+ MANDOCERR_ARG_NEG, /* negative argument, using 0: request arg */
MANDOCERR_BD_FILE, /* NOT IMPLEMENTED: Bd -file */
MANDOCERR_BD_NOARG, /* skipping display without arguments: Bd */
MANDOCERR_BL_NOTYPE, /* missing list type, using -item: Bl */