fix: proper va_end usage

main
Jef Roosens 2024-04-06 15:16:14 +02:00
parent 0e39ce3618
commit f5c0db7733
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
2 changed files with 4 additions and 2 deletions

View File

@ -8,7 +8,6 @@
#include "lnm/http/req.h"
#include "lnm/log.h"
#include "lnm/loop.h"
#include "lnm/loop_internal.h"
static const char *section = "http";

View File

@ -65,6 +65,9 @@ void lnm_vlog(lnm_log_level level, const char *section, const char *fmt,
continue;
}
va_list aq;
va_copy(aq, ap);
switch (stream->type) {
case lnm_logger_stream_type_file:
fprintf(stream->ptr, "[%s][%s][%s] ", date_str,
@ -74,7 +77,7 @@ void lnm_vlog(lnm_log_level level, const char *section, const char *fmt,
break;
}
va_end(ap);
va_end(aq);
}
}