From f8c107fbe3ba1ab9825973b8b52941f4577db88e Mon Sep 17 00:00:00 2001 From: baohongde Date: Tue, 9 Jul 2019 17:50:43 +0800 Subject: [PATCH] components/bt: Fix compile error with new toolchain Closes https://github.com/espressif/esp-idf/issues/3331 Closes https://github.com/espressif/esp-idf/issues/3734 --- components/bt/common/osi/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/bt/common/osi/config.c b/components/bt/common/osi/config.c index c1d9a8ad5..b1dcfeca5 100644 --- a/components/bt/common/osi/config.c +++ b/components/bt/common/osi/config.c @@ -440,8 +440,9 @@ bool config_save(const config_t *config, const char *filename) goto error; } }else { - uint count = (w_cnt_total / CONFIG_FILE_MAX_SIZE); - for (int i = 0; i <= count; i++) + int count = (w_cnt_total / CONFIG_FILE_MAX_SIZE); + assert(count <= 0xFF); + for (uint8_t i = 0; i <= count; i++) { snprintf(keyname, keyname_bufsz, "%s%d", CONFIG_KEY, i); if (i == count) {