Skip to content

Commit

Permalink
Fix compilation with clang 18+.
Browse files Browse the repository at this point in the history
  • Loading branch information
nwhitehorn committed Jun 25, 2024
1 parent 57d4aae commit deaaf4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcp/src/GCPLogger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ GCPLogger::Log(G3LogLevel level, const std::string &unit,
log_description, unit.c_str(), message.c_str(),
trimmed_filename.c_str(), line, func.c_str());

char log_message[messagesize + 1];
char *log_message = new char[messagesize + 1];

sprintf(log_message,
"%s (%s): %s (%s:%d in %s)",
Expand All @@ -140,6 +140,7 @@ GCPLogger::Log(G3LogLevel level, const std::string &unit,

log_deque_lock_.lock();
log_deque_.push_back(log_message);
delete [] log_message;

// These are for human viewing. No one will look at > 100 messages.
if (log_deque_.size() > 100)
Expand Down

0 comments on commit deaaf4a

Please sign in to comment.