diff options
author | Yunjin Lee <yunjin-.lee@samsung.com> | 2020-01-16 14:27:52 +0900 |
---|---|---|
committer | Yunjin Lee <yunjin-.lee@samsung.com> | 2020-01-16 14:27:52 +0900 |
commit | da0c8ec3073d36567a7416da049bce00e519e2db (patch) | |
tree | 0de94d2fa4356d1f7fc1ef2c4ad8efc321ccd2fa | |
parent | ba2eb6c6e101d6cc0d950dbdfccf05206ebd214d (diff) | |
download | askuser-popup-da0c8ec3073d36567a7416da049bce00e519e2db.tar.gz askuser-popup-da0c8ec3073d36567a7416da049bce00e519e2db.tar.bz2 askuser-popup-da0c8ec3073d36567a7416da049bce00e519e2db.zip |
Fix errors from gcc upgradesubmit/tizen/20200116.062036accepted/tizen/unified/20200116.112353
- 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: I4fdeb8a2fefef6ca271a20c4b3cfeee9f93583ec
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
-rw-r--r-- | ui/src/popup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/src/popup.c b/ui/src/popup.c index b6c9346..e35ffd5 100644 --- a/ui/src/popup.c +++ b/ui/src/popup.c @@ -49,6 +49,8 @@ #define TEXT_DOMAIN "askuser-popup" +#define COUNTER_LEN 26 + void send_response(const char *response, app_data_s *ad) //TODO: change to enum? { @@ -119,7 +121,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_text_set(ad->counter, counter); |