libubus: fix incompatible pointer types assigment
[project/ubus.git] / libubus.c
index 260e40f2f44b216947cf278ca4d0ad4bbec30a61..846ae83bcc1216f32067b0c771d8053d9190a33b 100644 (file)
--- a/libubus.c
+++ b/libubus.c
@@ -283,7 +283,7 @@ int ubus_connect_ctx(struct ubus_context *ctx, const char *path)
        ctx->connection_lost = ubus_default_connection_lost;
        ctx->pending_timer.cb = ubus_process_pending_msg;
 
-       ctx->msgbuf.data = calloc(UBUS_MSG_CHUNK_SIZE, sizeof(char));
+       ctx->msgbuf.data = calloc(1, UBUS_MSG_CHUNK_SIZE);
        if (!ctx->msgbuf.data)
                return -1;
        ctx->msgbuf_data_len = UBUS_MSG_CHUNK_SIZE;