vshymanskyy / Preferences

Preferences library for Arduino, ESP8266, RP2040, Particle, Realtek Ameba
MIT License
76 stars 15 forks source link

cannot store empty String key after once storing the same key with content. #1

Closed seife closed 1 year ago

seife commented 2 years ago

Basically what happened to me:

   prefs.putString("foo", "bar");

works fine. But clearing it later with

   prefs.putString("foo", "");

does not work, it still returns "bar".

I think it is necessary for the Preferences::putBytes function to also check for _fs_get_size() != len in addition to the _fs_verify() check.

I'll try to cook up a patch for that.