summaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-14 16:28:38 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-14 16:28:38 +0000
commitee80bf892e2ff6da773d4d60bbcd89c77421895c (patch)
tree1578f014bfeb76464555e2c0c9e0865b5f1a60d1 /html.c
parente1926dad13331d995f227c3347ddcedb77fe1688 (diff)
downloadmandoc-ee80bf892e2ff6da773d4d60bbcd89c77421895c.tar.gz
Fix an assertion failure triggered by print_otag("sw+-l", NULL).
Even though we skip the style when the argument is NULL, we must still consume the options. Not found with afl(1), but during manual testing of the previous patch...
Diffstat (limited to 'html.c')
-rw-r--r--html.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/html.c b/html.c
index c9c8088e..c3a66b8e 100644
--- a/html.c
+++ b/html.c
@@ -624,8 +624,13 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...)
su = va_arg(ap, struct roffsu *);
break;
case 'w':
- if ((arg2 = va_arg(ap, char *)) == NULL)
+ if ((arg2 = va_arg(ap, char *)) == NULL) {
+ if (*fmt == '+')
+ fmt++;
+ if (*fmt == '-')
+ fmt++;
break;
+ }
su = &mysu;
a2width(arg2, su);
if (*fmt == '+') {