]> sigrok.org Git - libsigrok.git/commitdiff
csv: Fix a segfault when using non-hardware input.
authorUwe Hermann <redacted>
Fri, 2 Sep 2016 18:05:52 +0000 (20:05 +0200)
committerUwe Hermann <redacted>
Sun, 4 Sep 2016 16:03:50 +0000 (18:03 +0200)
src/output/csv.c

index 9c6d8d5f70041057098370e89340922047988fda..6900200db1b0e63994895828d2e6fb2fb7f9d8ba 100644 (file)
@@ -236,7 +236,7 @@ static GString *gen_header(const struct sr_output *o,
                sr_info("Set sample period to %" PRIu64 " %s",
                        ctx->period, ctx->xlabel);
        }
-       ctx->title = o->sdi->driver->longname;
+       ctx->title = (o->sdi && o->sdi->driver) ? o->sdi->driver->longname : "unknown";
 
        /* Some metadata */
        if (ctx->header && !ctx->did_header) {