diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-04-05 21:17:49 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-04-05 21:17:49 +0000 |
commit | 682d0d5236b51344398be5c242cb1492600194f5 (patch) | |
tree | b784783393640df3d262fdc7e1af7e9899a7f593 /usr.bin | |
parent | e338fced38feb2bdd0f5a2adcf97ecf0936e02ee (diff) |
bugfix: make sure all variables are properly initialized
when rendering .ll (line length) requests. oops.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/term.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c index f1809195e9d..de9f85c9ad6 100644 --- a/usr.bin/mandoc/term.c +++ b/usr.bin/mandoc/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.80 2014/03/30 21:27:59 schwarze Exp $ */ +/* $Id: term.c,v 1.81 2014/04/05 21:17:48 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -626,6 +626,8 @@ term_setwidth(struct termp *p, const char *wstr) size_t width; int iop; + iop = 0; + width = 0; if (NULL != wstr) { switch (*wstr) { case ('+'): @@ -637,15 +639,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); } |