mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01: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:
parent
6b97c379ba
commit
2ab73c1fd5
@ -606,7 +606,7 @@ void Engine::LogAction(char const* format, ...)
|
|||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
vsprintf(buf, format, ap);
|
vsnprintf(buf, sizeof(buf), format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
lastAction += "|";
|
lastAction += "|";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user