summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadoslaw Czerski <r.czerski@samsung.com>2016-04-12 15:31:37 +0200
committerRadoslaw Czerski <r.czerski@samsung.com>2016-04-12 15:31:37 +0200
commit13485a7307f3e26fff821cbebee8cfb0df7a0a6f (patch)
treea3f17fb3b6022e68f764575817fbac40e8194c6e
parent95d657cc1a13f979a8a42984d11f845d90c19100 (diff)
downloadindicator-win-13485a7307f3e26fff821cbebee8cfb0df7a0a6f.tar.gz
indicator-win-13485a7307f3e26fff821cbebee8cfb0df7a0a6f.tar.bz2
indicator-win-13485a7307f3e26fff821cbebee8cfb0df7a0a6f.zip
modules/clock: Not thread safe function replaced.
strtok -> strtok_r Change-Id: Ifcb6e8771d9a3270f68d408bf5b5bf63ed396dba Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
-rw-r--r--src/modules/clock/clock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/clock/clock.c b/src/modules/clock/clock.c
index 0c5af00..d8c1472 100644
--- a/src/modules/clock/clock.c
+++ b/src/modules/clock/clock.c
@@ -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);
}