fix a svace issue 19/61419/1 accepted/tizen/common/20160311.201921 accepted/tizen/ivi/20160311.062354 accepted/tizen/mobile/20160311.062238 accepted/tizen/tv/20160311.062303 accepted/tizen/wearable/20160311.062330 submit/tizen/20160311.051353
authorJongkyu Koo <jk.koo@samsung.com>
Mon, 7 Mar 2016 23:10:09 +0000 (08:10 +0900)
committerJongkyu Koo <jk.koo@samsung.com>
Mon, 7 Mar 2016 23:10:09 +0000 (08:10 +0900)
Change-Id: Ibe579e21d2a6d84cca454cbf6a768ad3b4dbb99a
Signed-off-by: Jongkyu Koo <jk.koo@samsung.com>
common/ctsvc_vcard.c

index d631692..6a13a63 100644 (file)
@@ -2560,12 +2560,13 @@ static inline int __ctsvc_vcard_get_nickname(ctsvc_list_s *nickname_list, char *
        int ret = CONTACTS_ERROR_NONE;
        char *temp;
        char *start;
+       char *last;
        const char *separator = ",";
 
        start = __ctsvc_get_content_value(val);
        RETV_IF(NULL == start, CONTACTS_ERROR_NO_DATA);
 
-       temp = strtok(start, separator);
+       temp = strtok_r(start, separator, &last);
        while (temp) {
                if ('\0' == *temp) continue;
 
@@ -2585,7 +2586,7 @@ static inline int __ctsvc_vcard_get_nickname(ctsvc_list_s *nickname_list, char *
                contacts_record_set_str(nickname, _contacts_nickname.name, __ctsvc_vcard_remove_escape_char(start));
                contacts_list_add((contacts_list_h)nickname_list, nickname);
 
-               temp = strtok(NULL, separator);
+               temp = strtok_r(NULL, separator, &last);
        }
 
        return CONTACTS_ERROR_NONE;