diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2022-04-24 13:38:46 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2022-04-24 13:38:46 +0000 |
commit | 43f9fbf1c67bd7237ef7670c2fd3019a4bbc84f0 (patch) | |
tree | 38a625b9c89a8ddb151eed876697ef560453022a /regress/roff/shift/bad.in | |
parent | 90d64fa2f97635da52e38a1dfeba56f657a11bbd (diff) | |
download | mandoc-43f9fbf1c67bd7237ef7670c2fd3019a4bbc84f0.tar.gz |
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 'regress/roff/shift/bad.in')
-rw-r--r-- | regress/roff/shift/bad.in | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/regress/roff/shift/bad.in b/regress/roff/shift/bad.in index 809832de..22eff7e0 100644 --- a/regress/roff/shift/bad.in +++ b/regress/roff/shift/bad.in @@ -1,5 +1,5 @@ -.\" $OpenBSD: bad.in,v 1.1 2018/08/23 14:16:12 schwarze Exp $ -.TH SHIFT_BAD 1 "August 23, 2018" +.\" $OpenBSD: bad.in,v 1.2 2022/04/24 13:34:53 schwarze Exp $ +.TH SHIFT_BAD 1 "April 24, 2022" .SH NAME .B shift-bad \(en wrong usage of macro arguments @@ -22,6 +22,10 @@ argument used after call: "\$1" .de mym .shift badarg after shift badarg: "\\$1" +.br +.shift -1 +after shift \-1: "\\$1" +.br .shift 2 after excessive shift: \\n(.$ "\\$1" .. |