]> git.meshlink.io Git - meshlink/commitdiff
Fix compiler warnings on OpenBSD.
authorGuus Sliepen <guus@tinc-vpn.org>
Wed, 5 Dec 2012 13:42:21 +0000 (14:42 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Wed, 5 Dec 2012 13:42:21 +0000 (14:42 +0100)
src/logger.c
src/net_packet.c

index 6e3d2c01550ab2b4b8aa8f6c82217bfe0cf325f4..e01980e9480a7ff86b86bef99ac224bcdba868cd 100644 (file)
@@ -59,7 +59,8 @@ static void real_logger(int level, int priority, const char *message) {
                        case LOGMODE_FILE:
                                if(!now.tv_sec)
                                        gettimeofday(&now, NULL);
-                               strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now.tv_sec));
+                               time_t now_sec = now.tv_sec;
+                               strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now_sec));
                                fprintf(logfile, "%s %s[%ld]: %s\n", timestr, logident, (long)logpid, message);
                                fflush(logfile);
                                break;
index 81ca70a4c97031a6f13664770592d67b150d92ca..3c3397cdd103ba17c10b999d6ba3c147cfc94ac7 100644 (file)
@@ -739,11 +739,11 @@ bool receive_sptps_record(void *handle, uint8_t type, const char *data, uint16_t
 
        int offset = (type & PKT_MAC) ? 0 : 14;
        if(type & PKT_COMPRESSED) {
-               len = uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression);
-               if(len < 0) {
+               length_t ulen = uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression);
+               if(ulen < 0) {
                        return false;
                } else {
-                       inpkt.len = len + offset;
+                       inpkt.len = ulen + offset;
                }
                if(inpkt.len > MAXSIZE)
                        abort();