properly check for result after output module data()
authorBert Vermeulen <bert@biot.com>
Tue, 5 Mar 2013 20:31:50 +0000 (21:31 +0100)
committerBert Vermeulen <bert@biot.com>
Tue, 5 Mar 2013 20:31:50 +0000 (21:31 +0100)
sigrok-cli.c

index eba6966ee877134e88f2fb30c3164a463d20efcb..bc293179b4c8130a32ebbc517bbe6207f5be79de 100644 (file)
@@ -746,7 +746,7 @@ static void datafeed_in(const struct sr_dev_inst *sdi,
                                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_buf) {
+                               if (output_len) {
                                        fwrite(output_buf, 1, output_len, outfile);
                                        fflush(outfile);
                                        g_free(output_buf);