xbee_recv: fix frame data pointer
[protos/xbee-avr.git] / main.c
diff --git a/main.c b/main.c
index 24fba69..272090f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -114,7 +114,7 @@ static int parse_xmit_status(struct xbee_ctx *ctx,
        }
 
        /* see if it matches a xmit query (atcmd_query must be NULL) */
-       if (ctx->atcmd_query[0] == '\0') {
+       if (ctx->atcmd_query[0] != '\0') {
                printf("invalid response 2\n");
                return -1;
        }
@@ -231,7 +231,7 @@ int xbee_recv_data(struct xbee_recv_hdr *recvframe, unsigned len)
                        break;
                case RC_PROTO_TYPE_RANGE: {
                        struct rc_proto_range *rcr =
-                               (struct rc_proto_range *) recvframe;
+                               (struct rc_proto_range *) recvframe->data;
 
                        if (datalen != sizeof(struct rc_proto_range))
                                return -1;