We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3de4170 commit 88e9c37Copy full SHA for 88e9c37
targets/default/jerry-port-default-date.c
@@ -28,6 +28,10 @@ bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
28
struct timeval tv;
29
struct timezone tz;
30
31
+ /* gettimeofday may not fill tv, so zero-initializing */
32
+ tv.tv_sec = 0;
33
+ tv.tv_usec = 0;
34
+
35
/* gettimeofday may not fill tz, so zero-initializing */
36
tz.tz_minuteswest = 0;
37
tz.tz_dsttime = 0;
@@ -47,6 +51,10 @@ double jerry_port_get_current_time ()
47
51
{
48
52
49
53
54
55
56
57
50
58
gettimeofday (&tv, NULL);
59
60
return ((double) tv.tv_sec) * 1000.0 + ((double) tv.tv_usec) / 1000.0;
0 commit comments