From 8e1a28940c855254cd8db48c86e1da28a83f36c6 Mon Sep 17 00:00:00 2001 From: gengyuchao Date: Fri, 10 Jan 2020 19:56:40 +0800 Subject: [PATCH] ble:config.c remove the error code when there is no file in the nvs because it is not an error. --- components/bt/common/osi/config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/bt/common/osi/config.c b/components/bt/common/osi/config.c index 2174fa7dfa..14b98ca1d5 100644 --- a/components/bt/common/osi/config.c +++ b/components/bt/common/osi/config.c @@ -545,6 +545,9 @@ static void config_parse(nvs_handle_t fp, config_t *config) char *keyname = osi_calloc(keyname_bufsz); int buf_size = get_config_size_from_flash(fp); char *buf = osi_calloc(buf_size); + if(buf_size == 0) { //First use nvs + goto error; + } if (!line || !section || !buf || !keyname) { err_code |= 0x01; goto error;