aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitf7ae141bdbc537700c2e9f197c05fefe73126d5c (patch)
tree4f27d8c73c18ddebe36557792713f5d6de868fa1 /term.c
parenta53099a26f8d62f538d37d1e57468dd089af9b38 (diff)
downloadmandoc-f7ae141bdbc537700c2e9f197c05fefe73126d5c.tar.gz
mandoc-f7ae141bdbc537700c2e9f197c05fefe73126d5c.tar.zst
mandoc-f7ae141bdbc537700c2e9f197c05fefe73126d5c.zip
bugfix: make sure all variables are properly initialized
when rendering .ll (line length) requests. oops.
Diffstat (limited to 'term.c')
-rw-r--r--term.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/term.c b/term.c
index 29c4fcb8..1cd4f9d5 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.219 2014/03/30 21:28:01 schwarze Exp $ */
+/* $Id: term.c,v 1.220 2014/04/05 21:18:19 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}