From: Bert Vermeulen Date: Sun, 4 Apr 2010 18:51:04 +0000 (+0200) Subject: fix off-by-one error X-Git-Tag: libsigrok-0.1.0~580 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d2cd86ac26a00a95cb0497ba5cb807d4587b67ce;p=libsigrok.git fix off-by-one error --- diff --git a/output/output_text.c b/output/output_text.c index ae7a75a9..bc761771 100644 --- a/output/output_text.c +++ b/output/output_text.c @@ -162,7 +162,7 @@ static int data_binary(struct output *o, char *data_in, uint64_t length_in, char else outbuf[0] = 0; - if(length_in > ctx->unitsize) { + if(length_in >= ctx->unitsize) { for(offset = 0; offset <= length_in - ctx->unitsize; offset += ctx->unitsize) { memcpy(&sample, data_in + offset, ctx->unitsize); for(p = 0; p < ctx->num_enabled_probes; p++) {