From: Bert Vermeulen Date: Mon, 26 Aug 2013 21:42:09 +0000 (+0200) Subject: ols: Properly initialize entire single-sample buffer before start X-Git-Tag: libsigrok-0.2.2~77 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=abb39e6b8c9f2d512920dce440c0d8dd7a9a90f0;p=libsigrok.git ols: Properly initialize entire single-sample buffer before start The single sample buffer, up to 4 bytes long, was not getting initialized on (every) acquisition start, only after the first full sample was in. This caused the first sample to potentially hold garbage. --- diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 87e43080..cb037908 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -503,6 +503,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, /* Reset all operational states. */ devc->num_transfers = devc->num_samples = devc->num_bytes = 0; + memset(devc->sample, 0, 4); /* Send header packet to the session bus. */ std_session_send_df_header(cb_data, LOG_PREFIX);