From 8efa86f039009e8c610dd001ff3085aa6ebecc67 Mon Sep 17 00:00:00 2001 From: the-minions-of-cplu Date: Tue, 28 Dec 2021 15:54:26 +0800 Subject: [PATCH] fix compiling warnings of global.c Signed-off-by: the-minions-of-cplu --- frameworks/resmgr_lite/src/global.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frameworks/resmgr_lite/src/global.c b/frameworks/resmgr_lite/src/global.c index 34cf28f..6759734 100644 --- a/frameworks/resmgr_lite/src/global.c +++ b/frameworks/resmgr_lite/src/global.c @@ -205,9 +205,9 @@ int32_t GLOBAL_GetValueById(uint32_t id, const char *path, char **value) if (ret != EOK) { return MC_FAILURE; } - - char *locales[] = {tempLocale, ""}; - for (int i = 0; i < 2; i++) { // 2 means two locales + char emptyPath[1] = { '\0' }; + char *locales[] = {tempLocale, emptyPath}; + for (int i = 0; i < 2; i++) { // 2 current language and the default. if (GLOBAL_GetValueByIdInternal(id, path, locales[i], value) == MC_SUCCESS) { return MC_SUCCESS; } @@ -276,9 +276,9 @@ int32_t GLOBAL_GetValueByName(const char *name, const char *path, char **value) if (ret != EOK) { return MC_FAILURE; } - - char *locales[] = {tempLocale, ""}; - for (int i = 0; i < 2; i++) { // 2 means two locales + char emptyPath[1] = { '\0' }; + char *locales[] = {tempLocale, emptyPath}; + for (int i = 0; i < 2; i++) { // 2 current language and the default. if (GLOBAL_GetValueByNameInternal(name, path, locales[i], value) == MC_SUCCESS) { return MC_SUCCESS; } -- Gitee