diff --git a/src/locale/collation.cpp b/src/locale/collation.cpp index 2d787b5a..31465645 100644 --- a/src/locale/collation.cpp +++ b/src/locale/collation.cpp @@ -6,7 +6,8 @@ #include "collation.hpp" -#include +#include +#include #include #include "esp_flash_spi_init.h" @@ -61,7 +62,8 @@ auto GLibCollator::create() -> GLibCollator* { // We reserve the first 8 bytes of the partition for an identifier / name. // Copy it out, then crop the rest of the region so that the LC_COLLATE parser // doesn't see it. - std::string name{static_cast(region)}; + const char* region_as_str = static_cast(region); + std::string name{region_as_str, strnlen(region_as_str, 8)}; region = static_cast(region) + 8; auto data = std::make_unique();