Slightly more efficient.

This commit is contained in:
Daniel Caujolle-Bert 2025-03-04 17:34:16 +01:00
parent 27d099c5b7
commit 8a5b810c5e
No known key found for this signature in database
GPG key ID: 51AED7171EC00614

View file

@ -164,10 +164,11 @@ void Log(unsigned int level, const char* fmt, ...)
::sprintf(buffer, "%c: %04d-%02d-%02d %02d:%02d:%02d.%03lld ", LEVELS[level], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000LL);
#endif
size_t bufLen = ::strlen(buffer);
va_list vl;
va_start(vl, fmt);
::vsnprintf((buffer + ::strlen(buffer)), (500U - ::strlen(buffer)), fmt, vl);
::vsnprintf((buffer + bufLen), (500U - bufLen), fmt, vl);
va_end(vl);