Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
htsbuf: add two missing va_end() calls to htsbuf_vqprintf()
  • Loading branch information
perexg committed Oct 3, 2014
1 parent 02e2633 commit 0b991ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/htsbuf.c
Expand Up @@ -254,8 +254,8 @@ htsbuf_vqprintf(htsbuf_queue_t *hq, const char *fmt, va_list ap0)
char buf[100], *p, *np;

va_copy(ap, ap0);

n = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
if(n > -1 && n < sizeof(buf)) {
htsbuf_append(hq, buf, n);
return;
Expand All @@ -269,6 +269,7 @@ htsbuf_vqprintf(htsbuf_queue_t *hq, const char *fmt, va_list ap0)
/* Try to print in the allocated space. */
va_copy(ap, ap0);
n = vsnprintf(p, size, fmt, ap);
va_end(ap);
if(n > -1 && n < size) {
htsbuf_append_prealloc(hq, p, n);
return;
Expand Down

0 comments on commit 0b991ef

Please sign in to comment.