Skip to content

Commit

Permalink
rpl_reporting: sprintf -> snprintf
Browse files Browse the repository at this point in the history
This was failing to compile with AppleClang 14.0.0.14000029.

Thanks to Arunesh Choudhary for noticing.
  • Loading branch information
grooverdan committed Mar 24, 2023
1 parent 1efdf67 commit 15ca6c5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sql/rpl_reporting.h
Expand Up @@ -93,13 +93,13 @@ class Slave_reporting_capability
localtime_r(&skr, &tm_tmp);
start=&tm_tmp;

sprintf(timestamp, "%02d%02d%02d %02d:%02d:%02d",
start->tm_year % 100,
start->tm_mon+1,
start->tm_mday,
start->tm_hour,
start->tm_min,
start->tm_sec);
snprintf(timestamp, sizeof(timestamp), "%02d%02d%02d %02d:%02d:%02d",
start->tm_year % 100,
start->tm_mon+1,
start->tm_mday,
start->tm_hour,
start->tm_min,
start->tm_sec);
timestamp[15]= '\0';
}

Expand Down

0 comments on commit 15ca6c5

Please sign in to comment.