htsbuf: add two missing va_end() calls to htsbuf_vqprintf()
This commit is contained in:
parent
02e2633c2a
commit
0b991efe32
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue