X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fmotech-lps-30x%2Fprotocol.c;fp=src%2Fhardware%2Fmotech-lps-30x%2Fprotocol.c;h=b31f2ee1d33ad83bcf48f33e8881a32f55290f4b;hb=e4924d752b3a2e08d0ab90b0eb872c569c4c68c9;hp=ce097274428fc2f472c015dc6f4bd6c8b00c16bc;hpb=fe535a89c9b8dfceeb7706c71af5aad7f6dcda26;p=libsigrok.git diff --git a/src/hardware/motech-lps-30x/protocol.c b/src/hardware/motech-lps-30x/protocol.c index ce097274..b31f2ee1 100644 --- a/src/hardware/motech-lps-30x/protocol.c +++ b/src/hardware/motech-lps-30x/protocol.c @@ -76,6 +76,8 @@ static void process_line(struct sr_dev_inst *sdi) int auxint; devc = sdi->priv; + if (!devc) + return; switch (devc->acq_req_pending) { case 0: /* Should not happen... */ @@ -87,6 +89,7 @@ static void process_line(struct sr_dev_inst *sdi) case AQ_U2: case AQ_I1: case AQ_I2: + dbl = 0.0; if (sr_atod_ascii(devc->buf, &dbl) != SR_OK) { sr_err("Failed to convert '%s' to double, errno=%d %s", devc->buf, errno, g_strerror(errno)); @@ -94,6 +97,7 @@ static void process_line(struct sr_dev_inst *sdi) } break; case AQ_STATUS: + auxint = 0; if (sr_atoi(devc->buf, &auxint) != SR_OK) { sr_err("Failed to convert '%s' to int, errno=%d %s", devc->buf, errno, g_strerror(errno));