Skip to content

Commit

Permalink
apply requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wichern committed Jun 16, 2024
1 parent 59e4642 commit 46e838f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extras/ai-battle/HeadlessGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ using bfs::canonical;
#ifdef WIN32
HANDLE setupStdOut();
void printConsole(const char* fmt, ...);
#elif defined(__GNUC__)
void printConsole(const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
#else
void printConsole(const char* fmt, ...) __attribute__((format(gnu_printf, 1, 2)));
void printConsole(const char* fmt, ...);
#endif

HeadlessGame::HeadlessGame(const GlobalGameSettings& ggs, const bfs::path& map, const std::vector<AI::Info>& ais)
Expand Down Expand Up @@ -248,7 +250,7 @@ void printConsole(const char* fmt, ...)
static char buffer[512];
va_list args;
va_start(args, fmt);
int len = vsnprintf(buffer, sizeof(buffer), fmt, args);
const int len = vsnprintf(buffer, sizeof(buffer), fmt, args);
va_end(args);
if(len > 0 && (size_t)len < sizeof(buffer))
{
Expand Down

0 comments on commit 46e838f

Please sign in to comment.