Merge pull request #10169 from leoetlino/fmt-localtime

Use fmt::localtime instead of thread-unsafe std::localtime
This commit is contained in:
Mai M
2021-11-07 00:08:14 -04:00
committed by GitHub
4 changed files with 4 additions and 4 deletions

View File

@ -140,6 +140,6 @@ std::string SettingsHandler::GenerateSerialNumber()
// Must be 9 characters at most; otherwise the serial number will be rejected by SDK libraries,
// as there is a check to ensure the string length is strictly lower than 10.
// 3 for %j, 2 for %H, 2 for %M, 2 for %S.
return fmt::format("{:%j%H%M%S}", *std::localtime(&t));
return fmt::format("{:%j%H%M%S}", fmt::localtime(t));
}
} // namespace Common