htsbuf: add two missing va_end() calls to htsbuf_vqprintf()

This commit is contained in:
Jaroslav Kysela 2014-10-03 15:49:38 +02:00
parent 02e2633c2a
commit 0b991efe32

View file

@ -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;
@ -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;