Fix compiler warnings.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 25 Jun 2012 17:01:51 +0000 (19:01 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 25 Jun 2012 17:01:51 +0000 (19:01 +0200)
src/linux/device.c
src/net_socket.c

index cbf2152..5ae8947 100644 (file)
@@ -210,7 +210,7 @@ static bool write_packet(vpn_packet_t *packet) {
                        }
                        break;
                case DEVICE_TYPE_ETHERTAP:
-                       *(short int *)(packet->data - 2) = packet->len;
+                       memcpy(packet->data - 2, &packet->len, 2);
 
                        if(write(device_fd, packet->data - 2, packet->len + 2) < 0) {
                                logger(LOG_ERR, "Can't write to %s %s: %s", device_info, device,
index f49832f..2d1ecc5 100644 (file)
@@ -352,7 +352,7 @@ static void do_outgoing_pipe(connection_t *c, char *command) {
 
 void do_outgoing_connection(connection_t *c) {
        char *address, *port, *space;
-       struct addrinfo *proxyai;
+       struct addrinfo *proxyai = NULL;
        int result;
 
        if(!c->outgoing) {