From c90e31d90f48b12328a98977212fa788176e3073 Mon Sep 17 00:00:00 2001 From: daishengdong Date: Thu, 18 Jun 2020 21:02:00 +0800 Subject: [PATCH] fix return code of tos_kv_has_key when sanity check failed --- components/fs/kv/tos_kv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/fs/kv/tos_kv.c b/components/fs/kv/tos_kv.c index 37f42521..7c6e9392 100644 --- a/components/fs/kv/tos_kv.c +++ b/components/fs/kv/tos_kv.c @@ -1298,11 +1298,11 @@ __API__ int tos_kv_has_key(const char *key) int has_key = K_FALSE; if (!key) { - return KV_ERR_INVALID_PARAM; + return K_FALSE; } if (strlen(key) >= (uint8_t)-1) { - return KV_ERR_SIZE_EXCEEDED; + return K_FALSE; } kv_lock();