From: Gerhard Sittig Date: Sun, 24 Nov 2019 18:37:49 +0000 (+0100) Subject: decoder: accept skip count 0 (onewire_link, usb_signalling) X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=99e264892acc0d81b31a219d806a5e5c5efa46f8;p=libsigrokdecode.git decoder: accept skip count 0 (onewire_link, usb_signalling) A recent commit tightened the check for acceptable 'skip' sample counts. This broke the onewire_link and usb_signalling decoders' test sequences, which no longer pass with a minimum count of one. Relax the condition and accept a count of zero. This breaks gpib again for low total sample count option values, but this needs to get addressed differently. --- diff --git a/type_decoder.c b/type_decoder.c index 454e7ea..c097c7f 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -677,7 +677,7 @@ static int create_term_list(struct srd_decoder_inst *di, term->type = SRD_TERM_SKIP; term->num_samples_to_skip = num_samples_to_skip; term->num_samples_already_skipped = 0; - if (num_samples_to_skip < 1) + if (num_samples_to_skip < 0) term->type = SRD_TERM_ALWAYS_FALSE; } else { srd_err("Term key is neither a string nor a number.");