]> sigrok.org Git - libsigrok.git/commitdiff
fix off-by-one error
authorBert Vermeulen <redacted>
Sun, 4 Apr 2010 18:51:04 +0000 (20:51 +0200)
committerBert Vermeulen <redacted>
Thu, 8 Apr 2010 14:50:27 +0000 (16:50 +0200)
output/output_text.c

index ae7a75a914b23720afcbe3a787e981b2c7c4c315..bc7617714cfc9424ea47b1fbc9d594d6afd71c18 100644 (file)
@@ -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++) {