vshymanskyy / Preferences

Preferences library for Arduino, ESP8266, RP2040 and Particle. ESP32-compatible API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

seife opened this issue · comments

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.