summaryrefslogtreecommitdiffstats
path: root/term_ps.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-09 08:31:18 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-09 08:31:18 +0000
commita560a18cf09008f29e00db4014ecd394727489c8 (patch)
tree13657948b793a69698473d39dfe338d9288d2d38 /term_ps.c
parent21a2b28bbf9477322208667281f6c561985a17d7 (diff)
downloadmandoc-a560a18cf09008f29e00db4014ecd394727489c8.tar.gz
Forgot to increment into the nil terminator. And call va_end() while
we're at it.
Diffstat (limited to 'term_ps.c')
-rw-r--r--term_ps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/term_ps.c b/term_ps.c
index d795e56d..f44c3d01 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -125,6 +125,8 @@ ps_printf(struct termp *p, const char *fmt, ...)
pos = (int)p->engine.ps.psmargcur;
vsnprintf(&p->engine.ps.psmarg[pos], PS_BUFSLOP, fmt, ap);
p->engine.ps.psmargcur = strlen(p->engine.ps.psmarg);
+
+ va_end(ap);
}
@@ -143,7 +145,7 @@ ps_putchar(struct termp *p, char c)
PS_GROWBUF(p, 2);
pos = (int)p->engine.ps.psmargcur++;
- p->engine.ps.psmarg[pos] = c;
+ p->engine.ps.psmarg[pos++] = c;
p->engine.ps.psmarg[pos] = '\0';
}