]> sigrok.org Git - libsigrok.git/commitdiff
gnuplot: proper error message when using gnuplot output without logic probe
authorAurelien Jacobs <redacted>
Tue, 14 Jan 2014 21:59:33 +0000 (22:59 +0100)
committerAurelien Jacobs <redacted>
Tue, 14 Jan 2014 21:59:33 +0000 (22:59 +0100)
output/gnuplot.c

index 27a764c8ad209da04b816cc94772543b5f833fd2..cadd4fa3b8c2f4f46fdc742674e348561d975efa 100644 (file)
@@ -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);