From: Bert Vermeulen Date: Sat, 27 Apr 2013 15:34:00 +0000 (+0200) Subject: Use new output API receive() function X-Git-Tag: sigrok-cli-0.4.0~8 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=644bb1e88009546aadd919695d3dd602f06441d7;p=sigrok-cli.git Use new output API receive() function --- diff --git a/sigrok-cli.c b/sigrok-cli.c index ade15cd..a1ab736 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -872,15 +872,15 @@ static void datafeed_in(const struct sr_dev_inst *sdi, break; } - if (o && o->format->recv) { - out = o->format->recv(o, sdi, packet); - if (out && out->len) { + if (o && o->format->receive) { + if (o->format->receive(o, sdi, packet, &out) == SR_OK && out) { fwrite(out->str, 1, out->len, outfile); fflush(outfile); + g_string_free(out, TRUE); } } - /* SR_DF_END needs to be handled after the output module's recv() + /* SR_DF_END needs to be handled after the output module's receive() * is called, so it can properly clean up that module etc. */ if (packet->type == SR_DF_END) { g_debug("cli: Received SR_DF_END");