1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

time: Make std::string version of strftime() avoid runaway memory allocations (#5348)

This commit is contained in:
Kevin P. Fleming
2023-09-11 16:02:07 -04:00
committed by GitHub
parent 892d2ce34f
commit deb34c9473
2 changed files with 9 additions and 0 deletions

View File

@@ -45,6 +45,10 @@ struct ESPTime {
*
* @warning This method uses dynamically allocated strings which can cause heap fragmentation with some
* microcontrollers.
*
* @warning This method can return "ERROR" when the underlying strftime() call fails, e.g. when the
* format string contains unsupported specifiers or when the format string doesn't produce any
* output.
*/
std::string strftime(const std::string &format);