]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove a compiler warning from -O0 build
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 5 Nov 2013 22:00:58 +0000 (00:00 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Nov 2013 22:00:58 +0000 (00:00 +0200)
It looks like abs() result is signed and gcc warns about this when
running a build with -O0 but not with -O2.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/radius/radius_das.c

index 8e5988dd385aa735bd37931203b63e43a01bfec7..418b1605c12bc8b9fdb31588cbe213fbe5bdd9a4 100644 (file)
@@ -200,7 +200,8 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx)
                                  (u8 *) &val, 4);
        if (res == 4) {
                u32 timestamp = ntohl(val);
-               if (abs(now.sec - timestamp) > das->time_window) {
+               if ((unsigned int) abs(now.sec - timestamp) >
+                   das->time_window) {
                        wpa_printf(MSG_DEBUG, "DAS: Unacceptable "
                                   "Event-Timestamp (%u; local time %u) in "
                                   "packet from %s:%d - drop",