summaryrefslogtreecommitdiffstatshomepage
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
commitb4405b88c62581d578f4465b708c626057de8d4a (patch)
tree599ba92245b6dc9bb523768ffffc87ecf56ce88d /term_ps.c
parentdbcb21471c73a93f9436d4a342a5cc07d74fbf47 (diff)
downloadmandoc-b4405b88c62581d578f4465b708c626057de8d4a.tar.gz
mandoc-b4405b88c62581d578f4465b708c626057de8d4a.tar.zst
mandoc-b4405b88c62581d578f4465b708c626057de8d4a.zip
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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/term_ps.c b/term_ps.c
index 0d424035..464515ba 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -1,4 +1,4 @@
-/* $Id: term_ps.c,v 1.4 2010/06/09 08:07:13 kristaps Exp $ */
+/* $Id: term_ps.c,v 1.5 2010/06/09 08:31:18 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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';
}