From: Fabrice Desclaux Date: Mon, 20 Feb 2012 20:33:53 +0000 (+0100) Subject: xbee_recv: fix data pointer X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8c3e14e4eb2604046ff2b10ebdcc8a7b8381490e;p=protos%2Fxbee-avr.git xbee_recv: fix data pointer --- diff --git a/main.c b/main.c index b6014db..24fba69 100644 --- a/main.c +++ b/main.c @@ -219,7 +219,7 @@ static int dump_atcmd(struct xbee_ctx *ctx, struct xbee_atresp_hdr *frame, int xbee_recv_data(struct xbee_recv_hdr *recvframe, unsigned len) { int datalen = len - sizeof(*recvframe); - struct rc_proto_hdr *rch = (struct rc_proto_hdr *) recvframe; + struct rc_proto_hdr *rch = (struct rc_proto_hdr *) &recvframe->data; if (datalen < sizeof(struct rc_proto_hdr)) return -1;