From 5977b8eb5797459aed860317a5e12802361dcd65 Mon Sep 17 00:00:00 2001 From: Myungki Lee Date: Wed, 16 Dec 2015 17:37:15 +0900 Subject: [PATCH] Use a local variable to set locale. And fix strlen size. Change-Id: I04b98ef60342a744208d88f7c29016353aba21b3 Signed-off-by: Myungki Lee --- src/appcore-i18n.c | 7 ++++--- src/appcore.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/appcore-i18n.c b/src/appcore-i18n.c index ae853f6..fad7bf0 100644 --- a/src/appcore-i18n.c +++ b/src/appcore-i18n.c @@ -42,8 +42,9 @@ void update_lang(void) setenv("LC_MESSAGES", lang, 1); r = setlocale(LC_ALL, ""); if (r == NULL) { - r = setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET)); - _DBG("*****appcore setlocale=%s\n", r); + r = setlocale(LC_ALL, lang); + if (r != NULL) + _DBG("*****appcore setlocale=%s\n", r); } free(lang); } @@ -68,7 +69,7 @@ void update_region(void) setenv("LC_MEASUREMENT", region, 1); setenv("LC_IDENTIFICATION", region, 1); r = setlocale(LC_ALL, ""); - if (r == NULL) + if (r != NULL) _DBG("*****appcore setlocale=%s\n", r); free(region); diff --git a/src/appcore.c b/src/appcore.c index 407d081..2d12064 100644 --- a/src/appcore.c +++ b/src/appcore.c @@ -520,7 +520,7 @@ static int __aul_handler(aul_type type, bundle *b, void *data) _DBG("[APP %d] AUL event: AUL_START", _pid); #ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT bg = bundle_get_val(b, AUL_K_ALLOWED_BG); - if (bg && strncmp(bg, "ALLOWED_BG", strlen("ALLOWGED_BG")) == 0) { + if (bg && strncmp(bg, "ALLOWED_BG", strlen("ALLOWED_BG")) == 0) { _DBG("[__SUSPEND__] allowed background"); ac->allowed_bg = true; __remove_suspend_timer(data); -- 2.7.4