aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc_msg.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-04-24 13:38:46 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-04-24 13:38:46 +0000
commit3b18ea9139a1bdd9183db6f3ac6d174ad93b3cb3 (patch)
tree45cef6947de3a407683fabc94f2ba1f4385da7fc /mandoc_msg.c
parentc0ce7eb56abb536b1c8eaedec44f05b67e2bdf6a (diff)
downloadmandoc-3b18ea9139a1bdd9183db6f3ac6d174ad93b3cb3.tar.gz
mandoc-3b18ea9139a1bdd9183db6f3ac6d174ad93b3cb3.tar.zst
mandoc-3b18ea9139a1bdd9183db6f3ac6d174ad93b3cb3.zip
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 'mandoc_msg.c')
-rw-r--r--mandoc_msg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mandoc_msg.c b/mandoc_msg.c
index beec5059..0361fc80 100644
--- a/mandoc_msg.c
+++ b/mandoc_msg.c
@@ -1,6 +1,6 @@
/* $OpenBSD: mandoc_msg.c,v 1.8 2020/01/19 17:59:01 schwarze Exp $ */
/*
- * Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014-2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -216,6 +216,7 @@ static const char *const type_message[MANDOCERR_MAX] = {
"escaped character not allowed in a name",
"using macro argument outside macro",
"argument number is not numeric",
+ "negative argument, using 0",
"NOT IMPLEMENTED: Bd -file",
"skipping display without arguments",
"missing list type, using -item",