From: Bert Vermeulen Date: Tue, 11 Jan 2011 22:49:32 +0000 (+0100) Subject: code cleanup X-Git-Tag: libsigrok-0.1.0~447 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=78ed6420358cd83bb74208e80cbcd7c068713769;p=libsigrok.git code cleanup --- diff --git a/output/output_text.c b/output/output_text.c index 3c3fbb50..42fd1cac 100644 --- a/output/output_text.c +++ b/output/output_text.c @@ -112,8 +112,8 @@ static int init(struct output *o, int default_spl) } snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING); + num_probes = g_slist_length(o->device->probes); if (o->device->plugin) { - num_probes = g_slist_length(o->device->probes); samplerate = *((uint64_t *) o->device->plugin->get_device_info( o->device->plugin_index, DI_CUR_SAMPLERATE)); if (!(samplerate_s = sigrok_samplerate_string(samplerate))) { @@ -154,6 +154,8 @@ static int event(struct output *o, int event_type, char **data_out, switch (event_type) { case DF_TRIGGER: ctx->mark_trigger = ctx->spl_cnt; + *data_out = NULL; + *length_out = 0; break; case DF_END: outsize = ctx->num_enabled_probes @@ -166,6 +168,10 @@ static int event(struct output *o, int event_type, char **data_out, free(o->internal); o->internal = NULL; break; + default: + *data_out = NULL; + *length_out = 0; + break; } return SIGROK_OK;