]> sigrok.org Git - libsigrok.git/blobdiff - src/input/saleae.c
input/vcd: silence printf() format compiler warning
[libsigrok.git] / src / input / saleae.c
index cc954e627203fe4bec9dab7d82354ce70465b81b..f63181b3716a12bc2523a00fd81342061751c469 100644 (file)
@@ -199,7 +199,7 @@ static int create_channels(struct sr_input *in)
        struct context *inc;
        int type;
        size_t count, idx;
-       char name[4];
+       char name[24];
        struct sr_channel *ch;
 
        inc = in->priv;
@@ -813,11 +813,13 @@ static int parse_next_item(struct sr_input *in,
                diff_time /= inc->logic_state.l2d.sample_period;
                diff_time += 0.5;
                count = (uint64_t)diff_time;
-               digital = inc->feed.last.digital;
-               rc = addto_feed_buffer_logic(in, digital, count);
-               if (rc)
-                       return rc;
-               inc->feed.last.time = next_time;
+               if (count) {
+                       digital = inc->feed.last.digital;
+                       rc = addto_feed_buffer_logic(in, digital, count);
+                       if (rc)
+                               return rc;
+                       inc->feed.last.time = next_time;
+               }
                inc->feed.last.digital = 1 - inc->feed.last.digital;
                return SR_OK;
        case STAGE_L2A_FIRST_VALUE: