diff --git a/3rdpart/ZLToolKit b/3rdpart/ZLToolKit index ee7ae998..be74074d 160000 --- a/3rdpart/ZLToolKit +++ b/3rdpart/ZLToolKit @@ -1 +1 @@ -Subproject commit ee7ae998aa5449a72ccb9615104b2198bc971a65 +Subproject commit be74074d382a43e970de05fe88f412e5a05e38d6 diff --git a/api/source/mk_util.cpp b/api/source/mk_util.cpp index 18c21fef..6f50e185 100644 --- a/api/source/mk_util.cpp +++ b/api/source/mk_util.cpp @@ -11,6 +11,7 @@ #include "mk_util.h" #include #include +#include "Util/util.h" #include "Util/logger.h" using namespace std; using namespace toolkit; @@ -47,12 +48,12 @@ API_EXPORT char* API_CALL mk_util_hex_dump(const void *buf, int len){ API_EXPORT void API_CALL mk_log_printf(int level, const char *file, const char *function, int line, const char *fmt, ...) { assert(file && function && fmt); LogContextCapturer info(Logger::Instance(), (LogLevel) level, file, function, line); - va_list pArg; - va_start(pArg, fmt); - char buf[4096]; - auto n = vsnprintf(buf, sizeof(buf), fmt, pArg); - buf[n] = '\0'; - va_end(pArg); - info << buf; + va_list ap; + va_start(ap, fmt); + char *str = nullptr; + vasprintf(&str, fmt, ap); + va_end(ap); + info << str; + free(str); }