]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Avoid possible compiler warning in os_gmtime()
authorJouni Malinen <j@w1.fi>
Sun, 20 Nov 2011 10:19:28 +0000 (12:19 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 20 Nov 2011 10:19:28 +0000 (12:19 +0200)
Use time_t instead of os_time_t variable with the gmtime() call to
avoid possible compiler warnings.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/utils/os_internal.c
src/utils/os_unix.c
src/utils/os_win32.c

index 925aff5f27a674b47ecedd65bacff25a5b4bca93..8024a30745f8ee9a1f096a3aee943b49dbb5d9c3 100644 (file)
@@ -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;
index cadcb8d5824ba844b8ad34d2c0836bd9e16150f0..9b16b338463ecc6539869cd35199517260aa826e 100644 (file)
@@ -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;
index c93be301e97c516e1702fe3f7389a467bce5cbbb..51bd5456b5a54a7263a1a9d72023191f7a19ec15 100644 (file)
@@ -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;