From: Yunjin Lee Date: Thu, 16 Jan 2020 04:37:50 +0000 (+0900) Subject: Fix errors from gcc upgrade X-Git-Tag: accepted/tizen/unified/20200116.112358^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2bb56357982e5089ac8646b76783c8dd1e755357;p=profile%2Fmobile%2Fapps%2Fnative%2Faskuser-popup.git Fix errors from gcc upgrade - 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 [-2147483647, 2147483647] 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 --- diff --git a/ui/src/popup.c b/ui/src/popup.c index 0ba6531..10c9b3b 100644 --- a/ui/src/popup.c +++ b/ui/src/popup.c @@ -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);