From 0a798f421863d7c74bf7e8e6f37d8021e9df52f2 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 22 Apr 2022 12:42:01 -0700 Subject: til: make til_module_randomize_setup() return -errno This makes the arg return optional by using a res_arg pointer, instead returning -ENOMEM when it would have returned NULL on allocation failures. This also makes it possible to detect when no setup was performed, by returning 0 in such a case. Now returns 1 when setup occurs and res pointers populated. --- src/modules/rtv/rtv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c index 19dcdca..742b2bc 100644 --- a/src/modules/rtv/rtv.c +++ b/src/modules/rtv/rtv.c @@ -155,10 +155,10 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks) ctxt->channel = &ctxt->channels[i]; if (!ctxt->channel->settings) { - char *settings; + char *settings = NULL; txt_t *caption; - settings = til_module_randomize_setup(ctxt->channel->module, &ctxt->channel->module_setup); + (void) til_module_randomize_setup(ctxt->channel->module, &ctxt->channel->module_setup, &settings); caption = txt_newf("Title: %s%s%s\nDescription: %s%s%s", ctxt->channel->module->name, ctxt->channel->module->author ? "\nAuthor: " : "", -- cgit v1.2.1