mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-15 09:50:27 +00:00
Fix deprecated vsprintf usage in Engine logging 2nd edition (#1978)
Replace deprecated vsprintf with vsnprintf to eliminate compiler warning and prevent potential buffer overflow. Updated to latest commit. Tested in game and it seemed to log actions just fine. I just basically added a buffer size by using the current vsnprintf lib instead.
This commit is contained in:
@@ -606,7 +606,7 @@ void Engine::LogAction(char const* format, ...)
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
vsprintf(buf, format, ap);
|
||||
vsnprintf(buf, sizeof(buf), format, ap);
|
||||
va_end(ap);
|
||||
|
||||
lastAction += "|";
|
||||
|
||||
Reference in New Issue
Block a user