]> granicus.if.org Git - esp-idf/commitdiff
nvs_console: Fix type comparison
authorShivani Tipnis <shivani@espressif.com>
Thu, 2 May 2019 10:01:50 +0000 (15:31 +0530)
committerShivani Tipnis <shivani@espressif.com>
Thu, 2 May 2019 10:01:57 +0000 (15:31 +0530)
Closes https://github.com/espressif/esp-idf/issues/3320

examples/system/console/components/cmd_nvs/cmd_nvs.c

index a7e4319c424fcd579f3b7cf9f98135d35facb8f8..c075496ca6478b6c9baef59514b665ebf11e4874 100644 (file)
@@ -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;
         }
     }