summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunjin Lee <yunjin-.lee@samsung.com>2020-01-16 14:27:52 +0900
committerYunjin Lee <yunjin-.lee@samsung.com>2020-01-16 14:27:52 +0900
commitda0c8ec3073d36567a7416da049bce00e519e2db (patch)
tree0de94d2fa4356d1f7fc1ef2c4ad8efc321ccd2fa
parentba2eb6c6e101d6cc0d950dbdfccf05206ebd214d (diff)
downloadaskuser-popup-da0c8ec3073d36567a7416da049bce00e519e2db.tar.gz
askuser-popup-da0c8ec3073d36567a7416da049bce00e519e2db.tar.bz2
askuser-popup-da0c8ec3073d36567a7416da049bce00e519e2db.zip
- 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.c4
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);