Modified not to use invalid string length 20/272820/4
authorInHong Han <inhong1.han@samsung.com>
Fri, 25 Mar 2022 05:47:16 +0000 (14:47 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 25 Mar 2022 06:10:53 +0000 (15:10 +0900)
Change-Id: I0d15c8e6f36d0b76e6f7796d78969945a7065a31

src/e_mod_main.c

index bb34df1..e508811 100644 (file)
@@ -1195,8 +1195,10 @@ _e_mod_ecore_key_down_cb(void *data, int type, void *event)
        ecore_device_subclass_get(ev->dev) == ECORE_DEVICE_SUBCLASS_REMOCON)
      return ECORE_CALLBACK_PASS_ON;
 
-   /* process up/down/left/right and enter key exceptionally */
+   /* process up/down/left/right and some keys exceptionally */
    /* KP_XXX key is used as arrow key and number key in keypad, so ev->string is used for checking whether KP_XXX key is number key or not */
+   const char *XF86_key = "XF86";
+
    if ((!strcmp(ev->key, "KP_Down") ||
         !strcmp(ev->key, "KP_Up") ||
         !strcmp(ev->key, "KP_Right") ||
@@ -1210,8 +1212,8 @@ _e_mod_ecore_key_down_cb(void *data, int type, void *event)
        !strcmp(ev->key, "Return") ||
        !strcmp(ev->key, "Pause") ||
        !strcmp(ev->key, "NoSymbol") ||
-       !strncmp(ev->key, "XF86", 4) ||
-       !strncmp(ev->key, "Cancel", 5))
+       !strncmp(ev->key, XF86_key, strlen(XF86_key)) ||
+       !strcmp(ev->key, "Cancel"))
      return ECORE_CALLBACK_PASS_ON;
 
    SECURE_LOGI("Hide IME (key : %s)", ev->key);