From: Aurelien Jacobs Date: Tue, 14 Jan 2014 21:59:33 +0000 (+0100) Subject: gnuplot: proper error message when using gnuplot output without logic probe X-Git-Tag: libsigrok-0.3.0~287 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=365cca8aca560bdc3c5443a732e8d2620821a450;p=libsigrok.git gnuplot: proper error message when using gnuplot output without logic probe --- diff --git a/output/gnuplot.c b/output/gnuplot.c index 27a764c8..cadd4fa3 100644 --- a/output/gnuplot.c +++ b/output/gnuplot.c @@ -86,6 +86,11 @@ static int init(struct sr_output *o) continue; ctx->num_enabled_probes++; } + if (ctx->num_enabled_probes <= 0) { + sr_err("%s: no logic probe enabled", __func__); + return SR_ERR; + } + ctx->unitsize = (ctx->num_enabled_probes + 7) / 8; num_probes = g_slist_length(o->sdi->probes);