From: Soeren Apel Date: Thu, 30 Jul 2015 05:29:11 +0000 (+0200) Subject: output/srzip: Use sr_output->filename instead of option X-Git-Tag: libsigrok-0.4.0~455 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=37875f750614;p=libsigrok.git output/srzip: Use sr_output->filename instead of option This fixes parts of bug #570. --- diff --git a/src/output/srzip.c b/src/output/srzip.c index 84755a3d..690736c8 100644 --- a/src/output/srzip.c +++ b/src/output/srzip.c @@ -39,11 +39,16 @@ static int init(struct sr_output *o, GHashTable *options) { struct out_context *outc; + (void)options; + outc = g_malloc0(sizeof(struct out_context)); o->priv = outc; - outc->filename = g_strdup(g_variant_get_string(g_hash_table_lookup(options, "filename"), NULL)); - if (strlen(outc->filename) == 0) + + if (strlen(o->filename) == 0) { + sr_info("srzip output module requires a file name, cannot save."); return SR_ERR_ARG; + } + outc->filename = g_strdup(o->filename); return SR_OK; } @@ -296,7 +301,6 @@ static int cleanup(struct sr_output *o) } static struct sr_option options[] = { - { "filename", "Filename", "File to write", NULL, NULL }, ALL_ZERO };