summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-05 21:18:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-05 21:18:19 +0000
commit0fdf2f9021c12ccdf06e964a64d1155a265316d9 (patch)
tree01dd20ea99ffe1ddb4a70f0bfc21867bb48db720 /term.c
parenta6e0e907b41152b48f9766f3cfd1adfdfa28963c (diff)
downloadmandoc-0fdf2f9021c12ccdf06e964a64d1155a265316d9.tar.gz
bugfix: make sure all variables are properly initialized
when rendering .ll (line length) requests. oops.
Diffstat (limited to 'term.c')
-rw-r--r--term.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/term.c b/term.c
index a8f2d3f0..300376e0 100644
--- a/term.c
+++ b/term.c
@@ -630,6 +630,8 @@ term_setwidth(struct termp *p, const char *wstr)
size_t width;
int iop;
+ iop = 0;
+ width = 0;
if (NULL != wstr) {
switch (*wstr) {
case ('+'):
@@ -641,15 +643,13 @@ term_setwidth(struct termp *p, const char *wstr)
wstr++;
break;
default:
- iop = 0;
break;
}
- if ( ! a2roffsu(wstr, &su, SCALE_MAX)) {
- wstr = NULL;
+ if (a2roffsu(wstr, &su, SCALE_MAX))
+ width = term_hspan(p, &su);
+ else
iop = 0;
- }
}
- width = (NULL != wstr) ? term_hspan(p, &su) : 0;
(*p->setwidth)(p, iop, width);
}