diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-08-03 17:06:31 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-08-03 17:06:31 -0700 |
commit | 119e3805c1c3a50efb41056a830bc32a8fdec3ae (patch) | |
tree | 04d76d42ffefaeaa14cd095756383b86a642c201 /src | |
parent | f2ad42777ddf96038e08a29cce81acc1b426ae1e (diff) |
modules/rkt,til: use set_raw_value() api for overrides
The application of overrides was still done via ad-hoc value
manipulation. This changes to use til_setting_set_raw_value() in
the obvious manner.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/rkt/rkt_scener.c | 6 | ||||
-rw-r--r-- | src/setup.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/rkt/rkt_scener.c b/src/modules/rkt/rkt_scener.c index c491531..87d9e18 100644 --- a/src/modules/rkt/rkt_scener.c +++ b/src/modules/rkt/rkt_scener.c @@ -1056,8 +1056,10 @@ int rkt_scener_update(rkt_context_t *ctxt) return rkt_scener_err_close(scener, ENOMEM); if (o != setting->value) { - free((void *)setting->value); - setting->value = o; + r = til_setting_set_raw_value(setting, o); + free((void *)o); + if (r < 0) + return -ENOMEM; } } diff --git a/src/setup.c b/src/setup.c index 715708a..de71262 100644 --- a/src/setup.c +++ b/src/setup.c @@ -69,8 +69,10 @@ int setup_interactively(til_settings_t *settings, int (*setup_func)(const til_se return -ENOMEM; if (o != setting->value) { - free((void *)setting->value); - setting->value = o; + r = til_setting_set_raw_value(setting, o); + free((void *)o); + if (r < 0) + return -ENOMEM; } } |