Change-Id: Ided4e6fbfea0c8caf941a1a1a5fc05b1e05d79b3
struct tm *timenow;
time(&now);
- timenow = localtime(&now);
+ localtime_r(&now, timenow);
if (timenow) {
- fprintf(m_flog, "[ %s ] %s\n", log_message[level], asctime(timenow));
+ char buf[64] = { 0 };
+ asctime_r(timenow, buf);
+
+ fprintf(m_flog, "[ %s ] %s\n", log_message[level], buf);
fprintf(m_flog, "\t%s\n", str_log);
fflush(m_flog);
break;
case SCL_TIMER_AUTOTEST: {
srand(time(NULL));
- sclint rnd = rand() % 100;
+
+ unsigned int seed;
+ sclint rnd = rand_r(&seed) % 100;
const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
return FALSE;
}
srand(time(NULL));
- sclint x = (rand() % (layout->width));
+ sclint x = (rand_r(&seed) % (layout->width));
srand(time(NULL));
- sclint y = (rand() % (layout->height));
+ sclint y = (rand_r(&seed) % (layout->height));
if (rnd < 80) {
events->generate_mouse_event(SCL_MOUSE_EVENT_PRESS, x, y);