diff --git a/src/utils/os_internal.c b/src/utils/os_internal.c index 925aff5f2..8024a3074 100644 --- a/src/utils/os_internal.c +++ b/src/utils/os_internal.c @@ -73,8 +73,9 @@ int os_mktime(int year, int month, int day, int hour, int min, int sec, int os_gmtime(os_time_t t, struct os_tm *tm) { struct tm *tm2; + time_t t2 = t; - tm2 = gmtime(&t); + tm2 = gmtime(&t2); if (tm2 == NULL) return -1; tm->sec = tm2->tm_sec; diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index cadcb8d58..9b16b3384 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -109,8 +109,9 @@ int os_mktime(int year, int month, int day, int hour, int min, int sec, int os_gmtime(os_time_t t, struct os_tm *tm) { struct tm *tm2; + time_t t2 = t; - tm2 = gmtime(&t); + tm2 = gmtime(&t2); if (tm2 == NULL) return -1; tm->sec = tm2->tm_sec; diff --git a/src/utils/os_win32.c b/src/utils/os_win32.c index c93be301e..51bd5456b 100644 --- a/src/utils/os_win32.c +++ b/src/utils/os_win32.c @@ -96,8 +96,9 @@ int os_mktime(int year, int month, int day, int hour, int min, int sec, int os_gmtime(os_time_t t, struct os_tm *tm) { struct tm *tm2; + time_t t2 = t; - tm2 = gmtime(&t); + tm2 = gmtime(&t2); if (tm2 == NULL) return -1; tm->sec = tm2->tm_sec;