[Version] 0.1.5 [Project] Tizen 2.0 [Title] fix lanaguage value
authorNamKwanWoo <kw46.nam@samsung.com>
Mon, 12 Nov 2012 07:10:56 +0000 (16:10 +0900)
committerNamKwanWoo <kw46.nam@samsung.com>
Mon, 12 Nov 2012 07:10:56 +0000 (16:10 +0900)
[BinType] PDA [Customer] Public/Open/ ... [Issue#] N/A [Problem]
language value have character set [Cause] vconf language value have
character set [Solution] remove chracter set [Team] Kernel&SystemFW
[Developer] kw46.nam [Request] N/A [Horizontal expansion] N/A
[SCMRequest] N/A

Change-Id: I572406f4475413d475fe4bca9038c8454b3ac9d2

src/runtime_info_locale.c

index e2bc74e..e214914 100755 (executable)
@@ -130,13 +130,20 @@ void runtime_info_first_day_of_week_unset_event_cb()
 int runtime_info_language_get_value(runtime_info_value_h value)
 {
        char *vconf_value;
-       
+       char *token = NULL;
+
        if (runtime_info_vconf_get_value_string(VCONF_LANGUAGE, &vconf_value))
        {
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
-       value->s = vconf_value;
+       token = strtok(vconf_value, ".");
+       value->s = strdup(token);
+       free(vconf_value);
+       if (value->s == NULL) {
+               LOGE("[%s] OUT_OF_MEMORY(0x%08x)", __func__, RUNTIME_INFO_ERROR_OUT_OF_MEMORY);
+               return RUNTIME_INFO_ERROR_OUT_OF_MEMORY;
+       }
 
        return RUNTIME_INFO_ERROR_NONE;
 }