lib

morphux C utility library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/lib

commit 310b60ba10379a051e82ce43c721baff552060a7
parent 6251bc288c901e0827021dbb07e817e7d0c7f4ce
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon, 23 Jan 2017 20:47:05 +0100

Fix(mprint): Add va_end to the prints

Diffstat:
Msrc/m_print.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/m_print.c b/src/m_print.c @@ -26,6 +26,7 @@ void m_panic(const char *str, ...) { write(2, "\033[0;31m> \033[0m", 13); va_start(ap, str); vfprintf(stderr, str, ap); + va_end(ap); if (str[strlen(str) - 1] != '\n') fprintf(stderr, "\n"); _exit(1); @@ -41,6 +42,7 @@ void m_error(const char *str, ...) { write(2, "\033[0;31m> \033[0m", 13); va_start(ap, str); vfprintf(stderr, str, ap); + va_end(ap); if (str[strlen(str) - 1] != '\n') fprintf(stderr, "\n"); } @@ -55,6 +57,7 @@ void m_warning(const char *str, ...) { write(2, "\033[0;31m> \033[0m", 13); va_start(ap, str); vfprintf(stderr, str, ap); + va_end(ap); } /*! @@ -67,4 +70,5 @@ void m_info(const char *str, ...) { write(1, "\033[0;34m> \033[0m", 13); va_start(ap, str); vprintf(str, ap); + va_end(ap); }