source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Forgot to increment into the nil terminator.
Date: Wed, 9 Jun 2010 04:31:18 -0400 (EDT)	[thread overview]
Message-ID: <201006090831.o598VILS019352@krisdoz.my.domain> (raw)

Log Message:
-----------
Forgot to increment into the nil terminator.  And call va_end() while
we're at it.

Modified Files:
--------------
    mdocml:
        term_ps.c

Revision Data
-------------
Index: term_ps.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ps.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lterm_ps.c -Lterm_ps.c -u -p -r1.4 -r1.5
--- term_ps.c
+++ term_ps.c
@@ -125,6 +125,8 @@ ps_printf(struct termp *p, const char *f
 	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';
 }
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2010-06-09  8:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006090831.o598VILS019352@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).