cli: output API says to check data_out, not length_out
authorBert Vermeulen <bert@biot.com>
Tue, 12 Jun 2012 22:48:43 +0000 (00:48 +0200)
committerBert Vermeulen <bert@biot.com>
Mon, 18 Jun 2012 21:02:37 +0000 (23:02 +0200)
sigrok-cli.c

index a8e263dcf0cf082a9f0adf0a87cd4e9c10870946..a67b6a3be61ed219309744fd48a9529bafb418cc 100644 (file)
@@ -473,7 +473,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet)
                }
                if (o->format->event) {
                        o->format->event(o, SR_DF_END, &output_buf, &output_len);
-                       if (output_len) {
+                       if (output_buf) {
                                if (outfile)
                                        fwrite(output_buf, 1, output_len, outfile);
                                g_free(output_buf);
@@ -582,7 +582,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet)
                        output_len = 0;
                        if (o->format->data && packet->type == o->format->df_type)
                                o->format->data(o, filter_out, filter_out_len, &output_buf, &output_len);
-                       if (output_len) {
+                       if (output_buf) {
                                fwrite(output_buf, 1, output_len, outfile);
                                g_free(output_buf);
                        }