modules/clock: Not thread safe function replaced. 20/65820/1
authorRadoslaw Czerski <r.czerski@samsung.com>
Tue, 12 Apr 2016 13:31:37 +0000 (15:31 +0200)
committerRadoslaw Czerski <r.czerski@samsung.com>
Tue, 12 Apr 2016 13:31:37 +0000 (15:31 +0200)
strtok -> strtok_r

Change-Id: Ifcb6e8771d9a3270f68d408bf5b5bf63ed396dba
Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
src/modules/clock/clock.c

index 0c5af00..d8c1472 100644 (file)
@@ -585,10 +585,11 @@ void indicator_get_time_by_region(char* output,void *data)
        }
 
        char a_best_pattern[64] = {0,};
+       char *save_ptr;
        i18n_ustring_copy_au(a_best_pattern, u_best_pattern);
 
-       char *a_best_pattern_fixed = strtok(a_best_pattern, "a");
-       a_best_pattern_fixed = strtok(a_best_pattern_fixed, " ");
+       char *a_best_pattern_fixed = strtok_r(a_best_pattern, "a", &save_ptr);
+       a_best_pattern_fixed = strtok_r(a_best_pattern_fixed, " ", &save_ptr);
        if (a_best_pattern_fixed) {
                i18n_ustring_copy_ua(u_best_pattern, a_best_pattern_fixed);
        }