Closed elliotmatson closed 1 year ago
I think a better approach would be use snprintf instead of disable warnings, like this:
snprintf(_key, sizeof(_key), "%s", key);
snprintf(_value, sizeof(_value), "%s", value);
This would enforce \0 truncation if the source string is bigger than destination. It works the same way as strncpy, but it wont throw compiler warnings
Using @polaco1782 suggestion with #154
I was seeing this issue in ESP-IDF, this fixed it