From a1ac2a114ec423a745f219ff7ac3bcd8bc4f6fc6 Mon Sep 17 00:00:00 2001 From: liubb <1653617791@qq.com> Date: Sat, 12 Sep 2020 14:47:54 +0800 Subject: [PATCH] update kv_store/src/kvstore_common/kvstore_common.c. modify kv strncmp to strcmp --- kv_store/src/kvstore_common/kvstore_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kv_store/src/kvstore_common/kvstore_common.c b/kv_store/src/kvstore_common/kvstore_common.c index 5dce515..3244269 100755 --- a/kv_store/src/kvstore_common/kvstore_common.c +++ b/kv_store/src/kvstore_common/kvstore_common.c @@ -80,7 +80,7 @@ void DeleteKVCache(const char* key) return; } KvItem* item = g_itemHeader; - while (strncmp(key, item->key, strlen(key)) != 0) { + while (strcmp(key, item->key) != 0) { item = item->next; if (item == NULL) { return; @@ -156,7 +156,7 @@ int GetValueByCache(const char* key, char* value, unsigned int maxLen) return EC_FAILURE; } KvItem* item = g_itemHeader; - while (strncmp(key, item->key, strlen(key)) != 0) { + while (strcmp(key, item->key) != 0) { item = item->next; if (item == NULL) { return EC_FAILURE; -- Gitee