summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-11 03:27:17 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-11 03:29:52 +0200
commitb987b2cc645c0b56ae0dd98b043ded476dcbdd1c (patch)
tree0d6f49af6c8fe5b5e6e59f5d190eb25ad8a67c40 /degesch.c
parent30252e069d49b83033a7faf006b3b82dd1815ab1 (diff)
downloadxK-b987b2cc645c0b56ae0dd98b043ded476dcbdd1c.tar.gz
xK-b987b2cc645c0b56ae0dd98b043ded476dcbdd1c.tar.xz
xK-b987b2cc645c0b56ae0dd98b043ded476dcbdd1c.zip
degesch: add config_item_string_from_cstr()
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/degesch.c b/degesch.c
index 34a7975..86b9a0e 100644
--- a/degesch.c
+++ b/degesch.c
@@ -1639,12 +1639,7 @@ set_config_string
struct config_item_ *item = config_item_get (root, key, NULL);
hard_assert (item);
- struct str s;
- str_init (&s);
- str_append (&s, value);
- struct config_item_ *new_ = config_item_string (&s);
- str_free (&s);
-
+ struct config_item_ *new_ = config_item_string_from_cstr (value);
struct error *e = NULL;
if (config_item_set_from (item, new_, &e))
return true;
@@ -8700,12 +8695,7 @@ load_default_aliases (struct app_context *ctx)
for (size_t i = 0; i < N_ELEMENTS (g_default_aliases); i++)
{
const char **pair = g_default_aliases[i];
-
- struct str tmp;
- str_init (&tmp);
- str_append (&tmp, pair[1]);
- str_map_set (aliases, pair[0], config_item_string (&tmp));
- str_free (&tmp);
+ str_map_set (aliases, pair[0], config_item_string_from_cstr (pair[1]));
}
}