aboutsummaryrefslogtreecommitdiff
path: root/json-rpc-shell.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-08-08 09:08:20 +0200
committerPřemysl Eric Janouch <p@janouch.name>2024-08-08 09:08:33 +0200
commitac1a21eac8b5dfaa479ee3b552a49a9f172296e0 (patch)
treee668a0299a299f2b9e748549582c94e30456a4f8 /json-rpc-shell.c
parent693455006830f29f79cc94b277060dfe39a8b66f (diff)
downloadjson-rpc-shell-ac1a21eac8b5dfaa479ee3b552a49a9f172296e0.tar.gz
json-rpc-shell-ac1a21eac8b5dfaa479ee3b552a49a9f172296e0.tar.xz
json-rpc-shell-ac1a21eac8b5dfaa479ee3b552a49a9f172296e0.zip
Bump liberty, fix calloc argument order
Diffstat (limited to 'json-rpc-shell.c')
-rw-r--r--json-rpc-shell.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/json-rpc-shell.c b/json-rpc-shell.c
index aecc5d6..86e291d 100644
--- a/json-rpc-shell.c
+++ b/json-rpc-shell.c
@@ -601,7 +601,7 @@ input_el_on_return (EditLine *editline, int key)
int len = info->lastchar - info->buffer;
int point = info->cursor - info->buffer;
- wchar_t *line = calloc (sizeof *info->buffer, len + 1);
+ wchar_t *line = xcalloc (len + 1, sizeof *info->buffer);
memcpy (line, info->buffer, sizeof *info->buffer * len);
if (*line)
@@ -762,7 +762,7 @@ input_el_hide (struct input *input)
int len = info->lastchar - info->buffer;
int point = info->cursor - info->buffer;
- wchar_t *line = calloc (sizeof *info->buffer, len + 1);
+ wchar_t *line = xcalloc (len + 1, sizeof *info->buffer);
memcpy (line, info->buffer, sizeof *info->buffer * len);
el_cursor (self->editline, len - point);
el_wdeletestr (self->editline, len);
@@ -1225,7 +1225,7 @@ await_try_cancel (struct app_context *ctx)
static void on_config_attribute_change (struct config_item *item);
-static struct config_schema g_config_connection[] =
+static const struct config_schema g_config_connection[] =
{
{ .name = "tls_ca_file",
.comment = "OpenSSL CA bundle file",
@@ -1236,7 +1236,7 @@ static struct config_schema g_config_connection[] =
{}
};
-static struct config_schema g_config_attributes[] =
+static const struct config_schema g_config_attributes[] =
{
#define XX(x, y, z) { .name = y, .comment = z, .type = CONFIG_ITEM_STRING, \
.on_change = on_config_attribute_change },