Lock::init();
Lock lock;
NVS_DEBUGV("%s %d %d\r\n", __func__, baseSector, sectorCount);
+ s_nvs_handles.clear();
return s_nvs_storage.init(baseSector, sectorCount);
}
return err;
}
- if (length != nullptr && out_value == nullptr) {
+ if (length == nullptr) {
+ return ESP_ERR_NVS_INVALID_LENGTH;
+ }
+ else if (out_value == nullptr) {
*length = dataSize;
return ESP_OK;
}
-
- if (length == nullptr || *length < dataSize) {
+ else if (*length < dataSize) {
+ *length = dataSize;
return ESP_ERR_NVS_INVALID_LENGTH;
}