X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Fopenbench-logic-sniffer%2Fprotocol.c;h=bf065c760889ea21d2cfad6b93982eaec833c3d4;hp=dbf291439a1c71a28fd8ce48dce9dc83049fca29;hb=cfe55d09538457ae4d620a0b8c1c81ea979e4954;hpb=fe4acad1c2e39040c787b6245284b29c8b1b1c20 diff --git a/src/hardware/openbench-logic-sniffer/protocol.c b/src/hardware/openbench-logic-sniffer/protocol.c index dbf29143..bf065c76 100644 --- a/src/hardware/openbench-logic-sniffer/protocol.c +++ b/src/hardware/openbench-logic-sniffer/protocol.c @@ -476,7 +476,7 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data) * the number of channels. */ j = 0; - memset(devc->tmp_sample, 0, 4); + uint8_t tmp_sample[4] = { 0, 0, 0, 0 }; for (i = 0; i < 4; i++) { if (((devc->capture_flags >> 2) & (1 << i)) == 0) { @@ -485,17 +485,17 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data) * enabled, copy from received * sample. */ - devc->tmp_sample[i] = + tmp_sample[i] = devc->sample[j++]; } else if (devc->capture_flags & CAPTURE_FLAG_DEMUX && (i > 2)) { /* group 2 & 3 get added to 0 & 1 */ - devc->tmp_sample[i - 2] = + tmp_sample[i - 2] = devc->sample[j++]; } } - memcpy(devc->sample, devc->tmp_sample, 4); + memcpy(devc->sample, tmp_sample, 4); sr_spew("Expanded sample: 0x%.2hhx%.2hhx%.2hhx%.2hhx ", devc->sample[3], devc->sample[2], devc->sample[1], devc->sample[0]);