e_info_server: change win_id type to uint64_t 21/293521/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 31 May 2023 05:11:33 +0000 (14:11 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 31 May 2023 06:27:58 +0000 (15:27 +0900)
Change-Id: I9a9ebd80d4d72b118512dc33e32e3cff48f6b0a4

src/bin/e_info_server.c

index 658f57b..32ce286 100644 (file)
@@ -4550,30 +4550,30 @@ static Eldbus_Message *
 _e_info_server_cb_selected_buffer_dump(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
 {
    Eldbus_Message *reply = eldbus_message_method_return_new(msg);
-   const char *win_id_s = NULL;
+   const char *win_str = NULL;
    const char *path = NULL;
-   int32_t win_id = 0;
+   uint64_t win_id = 0;
+   unsigned long tmp;
    Evas_Object *o;
-   int ret;
+   Eina_Bool res = EINA_FALSE;
 
    Dump_Win_Data *dump = NULL;
    E_Capture_Save_State state;
 
-   if (!eldbus_message_arguments_get(msg, "ss", &win_id_s, &path))
+   if (!eldbus_message_arguments_get(msg, "ss", &win_str, &path))
      {
         ERR("Error getting arguments.");
         return reply;
      }
 
-    if (!win_id_s) win_id = 0;
-    else
-      {
-         if (strlen(win_id_s) >= 2 && win_id_s[0] == '0' && win_id_s[1] == 'x')
-           ret = sscanf(win_id_s, "%zx", (uintptr_t *)&win_id);
-         else
-           ret = sscanf(win_id_s, "%d", &win_id);
-         EINA_SAFETY_ON_FALSE_GOTO(ret == 1, end);
-      }
+     if (strlen(win_str) >= 2 && win_str[0] == '0' && win_str[1] == 'x')
+       res = e_util_string_to_ulong(win_str, &tmp, 16);
+     else
+       res = e_util_string_to_ulong(win_str, &tmp, 10);
+
+     EINA_SAFETY_ON_FALSE_GOTO(res == EINA_TRUE, end);
+
+     win_id = (uint64_t)tmp;
 
    for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
      {