X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Foutput%2Fols.c;h=5266c27c77526ecdcf48381b43cfae9148c91b5f;hb=6ec6c43b4738dbc7091f4a49a4ec80ea6102cb52;hp=8d68bdaf91e728639bd560c6c0474fb6fe51a280;hpb=d686c5ec462a4044e049931e57d60e9d08df8cde;p=libsigrok.git diff --git a/src/output/ols.c b/src/output/ols.c index 8d68bdaf..5266c27c 100644 --- a/src/output/ols.c +++ b/src/output/ols.c @@ -25,10 +25,11 @@ * https://github.com/jawi/ols/wiki/OLS-data-file-format */ +#include #include #include #include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" #define LOG_PREFIX "output/ols" @@ -44,12 +45,8 @@ static int init(struct sr_output *o, GHashTable *options) (void)options; - if (!(ctx = g_try_malloc(sizeof(struct context)))) { - sr_err("%s: ctx malloc failed", __func__); - return SR_ERR_MALLOC; - } + ctx = g_malloc0(sizeof(struct context)); o->priv = ctx; - ctx->samplerate = 0; ctx->num_samples = 0; @@ -154,6 +151,8 @@ SR_PRIV struct sr_output_module output_ols = { .id = "ols", .name = "OLS", .desc = "OpenBench Logic Sniffer", + .exts = (const char*[]){"ols", NULL}, + .flags = 0, .options = NULL, .init = init, .receive = receive,