From 893c1d82f7b5c804043a711f26ac321ad222e258 Mon Sep 17 00:00:00 2001 From: Shivani Tipnis Date: Thu, 2 May 2019 15:31:50 +0530 Subject: [PATCH] nvs_console: Fix type comparison Closes https://github.com/espressif/esp-idf/issues/3320 --- examples/system/console/components/cmd_nvs/cmd_nvs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/system/console/components/cmd_nvs/cmd_nvs.c b/examples/system/console/components/cmd_nvs/cmd_nvs.c index a7e4319c42..c075496ca6 100644 --- a/examples/system/console/components/cmd_nvs/cmd_nvs.c +++ b/examples/system/console/components/cmd_nvs/cmd_nvs.c @@ -78,7 +78,7 @@ static nvs_type_t str_to_type(const char *type) { for (int i = 0; i < TYPE_STR_PAIR_SIZE; i++) { const type_str_pair_t *p = &type_str_pair[i]; - if (strncmp(type, p->str, strlen(p->str)) == 0) { + if (strcmp(type, p->str) == 0) { return p->type; } }