Fixing build error 82/89382/3 accepted/tizen/ivi/20160926.000643 accepted/tizen/mobile/20160926.000551 accepted/tizen/tv/20160926.000607 accepted/tizen/wearable/20160926.000625 submit/tizen/20160923.052548
authorMyoungJune Park <mj2004.park@samsung.com>
Fri, 23 Sep 2016 08:41:17 +0000 (17:41 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Fri, 23 Sep 2016 09:09:11 +0000 (02:09 -0700)
- iniparser api spec modified

Change-Id: I1287de7f8694f02215f8ac747a233e7277954f15
Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
src/widget_service.c

index b63dac5..a77cce4 100644 (file)
@@ -282,14 +282,14 @@ static int _resolution_update_from_file(void)
        int height_type = 0;
        int width = 0;
        int height = 0;
-       char *type_str;
        char *size_str;
        dictionary *dic;
        char *file_path = NULL;
        int key_num;
-       char **key_list;
        char key_format[MAX_COLUMN];
        int i;
+       char **key_list;
+       const char *type_str;
 
        file_path = _resolution_file_path();
        if (file_path == NULL)
@@ -303,10 +303,11 @@ static int _resolution_update_from_file(void)
        snprintf(key_format, sizeof(key_format), "%s:%s",
                        RESOLUTION_SECTION_NAME, RESOLUTION_FORMAT);
        key_num = iniparser_getsecnkeys(dic, RESOLUTION_SECTION_NAME);
-       key_list = iniparser_getseckeys(dic, RESOLUTION_SECTION_NAME);
+       key_list = (char**) malloc(sizeof(char*)*key_num);
+       key_list = iniparser_getseckeys(dic, RESOLUTION_SECTION_NAME, (const char**)key_list);
        for (i = 0; i < key_num; i++) {
                type_str = key_list[i];
-               size_str = iniparser_getstring(dic, type_str, NULL);
+               size_str = iniparser_getstring(dic, (const char*)type_str, NULL);
                if (sscanf(type_str, key_format, &width_type, &height_type) != 2) {
                        _E("Invalid syntax: [%s]", type_str);
                        continue;
@@ -319,7 +320,8 @@ static int _resolution_update_from_file(void)
                _resolution_update_size_list(width_type, height_type, width, height);
        }
        iniparser_freedict(dic);
-
+       free(key_list);
+       key_list = NULL;
        return WIDGET_ERROR_NONE;
 }