]> git.droids-corp.org - protos/xbee-avr.git/commitdiff
xbee_recv: fix data pointer
authorFabrice Desclaux <serpilliere@droids-corp.org>
Mon, 20 Feb 2012 20:33:53 +0000 (21:33 +0100)
committerFabrice Desclaux <serpilliere@droids-corp.org>
Mon, 20 Feb 2012 20:33:53 +0000 (21:33 +0100)
main.c

diff --git a/main.c b/main.c
index b6014db2a1ddfb8f1c31e77b4daca5094fc7fdf7..24fba694e914b892f6b5540729dd86965364c07d 100644 (file)
--- 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;