You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Fix Xcode deprecation warning about sprintf usage
(cherry picked from commit b778c5caa3)
This commit is contained in:
@@ -151,10 +151,11 @@ void RotatedFileLogger::rotate_file() {
|
|||||||
|
|
||||||
if (FileAccess::exists(base_path)) {
|
if (FileAccess::exists(base_path)) {
|
||||||
if (max_files > 1) {
|
if (max_files > 1) {
|
||||||
char timestamp[21];
|
const size_t TIMESTAMP_SIZE = 21;
|
||||||
|
char timestamp[TIMESTAMP_SIZE];
|
||||||
OS::Date date = OS::get_singleton()->get_date();
|
OS::Date date = OS::get_singleton()->get_date();
|
||||||
OS::Time time = OS::get_singleton()->get_time();
|
OS::Time time = OS::get_singleton()->get_time();
|
||||||
sprintf(timestamp, "_%04d-%02d-%02d_%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
|
snprintf(timestamp, TIMESTAMP_SIZE, "_%04d-%02d-%02d_%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
|
||||||
|
|
||||||
String backup_name = base_path.get_basename() + timestamp;
|
String backup_name = base_path.get_basename() + timestamp;
|
||||||
if (base_path.get_extension() != String()) {
|
if (base_path.get_extension() != String()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user