Skip to content

Commit 3466602

Browse files
committed
time_: switch to reentrant version of localtime CWE-676
1 parent 4a8b40c commit 3466602

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/time_.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct number *eval_time(void) {
6666
time_t midnight;
6767

6868
time(&now); /* get current time */
69-
t = *localtime(&now);
69+
t = *localtime_r(&now, &t);
7070

7171
t.tm_hour = 0; /* rewind to midnight */
7272
t.tm_min = 0;

0 commit comments

Comments
 (0)