Fix issue about strtok detected by static analysis tool
[platform/core/uifw/inputdelegator.git] / src / w-input-emoticon.cpp
index e3b9b9d..d6e17bf 100755 (executable)
@@ -313,12 +313,12 @@ void get_recent_emoticons(vector <int> &emoticon_list)
     PRINTFUNC(DLOG_DEBUG, "str = %s", str);
 
     if (str != NULL) {
-        char *tok;
-        tok = strtok(str, ",");
+        char *tok, *ptr;
+        tok = strtok_r(str, ",", &ptr);
         while (tok != NULL) {
             PRINTFUNC(DLOG_DEBUG, "tok = %s", tok);
             emoticon_list.push_back(strtol(tok, (char **)NULL, 10));
-            tok = strtok(NULL, ",");
+            tok = strtok_r(NULL, ",", &ptr);
         }
     }