ayushsharma82 / ESP-DASH

Blazing fast library to create a functional dashboard for ESP8266 / ESP32
https://espdash.pro
GNU General Public License v3.0
976 stars 200 forks source link

Fix compile on ESP-IDF 4.4.3 #148

Closed elliotmatson closed 1 year ago

elliotmatson commented 1 year ago

I was seeing this issue in ESP-IDF, this fixed it

polaco1782 commented 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

ayushsharma82 commented 1 year ago

Using @polaco1782 suggestion with #154