From 0a84f9cb8f52f2d2b4f03a5ad5ef9dfcd3509033 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 25 Jun 2012 19:01:51 +0200 Subject: [PATCH] Fix compiler warnings. --- src/linux/device.c | 2 +- src/net_socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linux/device.c b/src/linux/device.c index cbf21529..5ae89478 100644 --- a/src/linux/device.c +++ b/src/linux/device.c @@ -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, diff --git a/src/net_socket.c b/src/net_socket.c index f49832f8..2d1ecc50 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -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) { -- 2.39.5