Fix errors from gcc upgrade 49/222549/2 accepted/tizen/unified/20200116.112358 submit/tizen/20200116.062044
authorYunjin Lee <yunjin-.lee@samsung.com>
Thu, 16 Jan 2020 04:37:50 +0000 (13:37 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Thu, 16 Jan 2020 04:56:12 +0000 (13:56 +0900)
- We know that the number of privacies is under 100 so it never will
exceed the length of counter but gcc determined it might cause a problem
so change the size of counter enough

- int can have [-21474836472147483647] value and if it is printed as
char then it will use 1~11 bytes. We knew that privacy num will not exceed
2bytes so assined 10 bytes for counter. But gcc says it should be enough
size for 2 int and 3 byte chars, so I fixed the size of counter enough.

Change-Id: Id9f3a47d806d5f962688f2fbb581168ce5657aa1
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
ui/src/popup.c

index 0ba6531..10c9b3b 100644 (file)
@@ -46,6 +46,8 @@
 
 #define TEXT_DOMAIN "askuser-popup"
 
+#define COUNTER_LEN 26
+
 
 void send_response(const char *response, app_data_s *ad) //TODO: change to enum?
 {
@@ -116,7 +118,7 @@ static void __set_popup_contents(app_data_s *ad)
        elm_object_text_set(ad->label, __get_message(ad->caller_pkgid, (const char*)pd->privacy));
        elm_atspi_accessible_name_set(ad->label, __get_message(ad->caller_pkgid, (const char*)pd->privacy));
        if (!strcmp(ad->launch_type, "multi")) {
-               char counter[10];
+               char counter[COUNTER_LEN];
                int ret = sprintf(counter, "%d / %d", (ad->privacy_idx) + 1, ad->privacy_num);
                LOGD("counter %s", counter);
                elm_object_part_text_set(ad->layout, "elm.privilege_counter", counter);