Merge pull request #344 from MaddTheSane/patch-1

Add missing va_end calls
This commit is contained in:
Louis Gombert 2024-05-14 14:39:49 +02:00 committed by GitHub
commit 86c8681afb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1225,6 +1225,7 @@ void aShowHUDMessage(const char *format, ...) {
va_start(args, format);
_vsnprintf(mstruct.message, sizeof(mstruct.message) - 1, format, args);
va_end(args);
mstruct.message[sizeof(mstruct.message) - 1] = 0; // if message too long, vsnprintf() won't terminate
mstruct.state = 0; // means all players
@ -1252,6 +1253,7 @@ void aShowHUDMessageObj(const char *format, int objhandle, ...) {
va_start(args, objhandle);
_vsnprintf(mstruct.message, sizeof(mstruct.message) - 1, format, args);
va_end(args);
mstruct.message[sizeof(mstruct.message) - 1] = 0; // if message too long, vsnprintf() won't terminate
mstruct.state = 1; // means specific player
@ -1282,6 +1284,7 @@ void aShowColoredHUDMessage(int red, int green, int blue, const char *format, ..
va_start(args, format);
_vsnprintf(mstruct.message, sizeof(mstruct.message) - 1, format, args);
va_end(args);
mstruct.message[sizeof(mstruct.message) - 1] = 0; // if message too long, vsnprintf() won't terminate
mstruct.state = 0; // means all players
@ -1312,6 +1315,7 @@ void aShowColoredHUDMessageObj(int red, int green, int blue, const char *format,
va_start(args, objhandle);
_vsnprintf(mstruct.message, sizeof(mstruct.message) - 1, format, args);
va_end(args);
mstruct.message[sizeof(mstruct.message) - 1] = 0; // if message too long, vsnprintf() won't terminate
mstruct.state = 1;