From 9e43e62e3b96234d02c0528a40771379d903182d Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 13 Nov 2022 00:39:09 +0100 Subject: [PATCH] Ported: [iOS] Fix build with warnings=extra. - bruvzg https://github.com/godotengine/godot/commit/987723b386f2b63ea33294c81ce026c6b45e1ae3 --- core/io/logger.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/io/logger.cpp b/core/io/logger.cpp index f8b70c86c..d5c3a6104 100644 --- a/core/io/logger.cpp +++ b/core/io/logger.cpp @@ -34,6 +34,7 @@ #include "core/os/os.h" #include "core/string/print_string.h" #include "core/config/project_settings.h" +#include "core/os/time.h" // va_copy was defined in the C99, but not in C++ standards before C++11. // When you compile C++ without --std=c++ option, compilers still define @@ -169,11 +170,7 @@ void RotatedFileLogger::rotate_file() { if (FileAccess::exists(base_path)) { if (max_files > 1) { - char timestamp[21]; - OS::Date date = OS::get_singleton()->get_date(); - 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); - + String timestamp = Time::get_singleton()->get_datetime_string_from_system().replace(":", "."); String backup_name = base_path.get_basename() + timestamp; if (base_path.get_extension() != String()) { backup_name += "." + base_path.get_extension();