Update the way handling lc_numeric 87/194587/4
authorn1214.hwang <n1214.hwang@samsung.com>
Thu, 6 Dec 2018 04:57:20 +0000 (13:57 +0900)
committerHermet Park <chuneon.park@samsung.com>
Fri, 7 Dec 2018 02:51:50 +0000 (02:51 +0000)
- https://review.tizen.org/gerrit/#/c/platform/upstream/efl/+/194095/
- setlocale(LC_NUMERIC, NULL) returns char* and this value will be changed again when setlocale called
- So, update the lc_numeric value at specific timing, it should copid as string.

Change-Id: I7fe5a222634641825e638670220defa86cb41c72

src/lib/ecore_wl2/ecore_wl2_input.c

index 39f16e9..0c59291 100644 (file)
@@ -178,9 +178,14 @@ _ecore_wl2_input_key_conversion_set(Ecore_Wl2_Input *input)
    else
      {
         char* lc_numeric = setlocale(LC_NUMERIC, NULL);
+        char* old_numeric = lc_numeric? strdup(lc_numeric) : NULL;
         setlocale(LC_NUMERIC, "C");
         _tizen_api_version = atof(temp);
-        setlocale(LC_NUMERIC, lc_numeric);
+        if(old_numeric)
+          {
+             setlocale(LC_NUMERIC, old_numeric);
+             free(old_numeric);
+          }
         INF("TIZEN_API_VERSION: %lf, Environment variable: %s\n", _tizen_api_version, temp);
         if (_tizen_api_version < 2.4)
           {