From 378cc549ab442c845ac9d62cc8cef6977073fe4d Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Sat, 15 Aug 2026 13:55:35 +0530 Subject: md files --- src/uci/command.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/uci/command.c') diff --git a/src/uci/command.c b/src/uci/command.c index 583b887..327e0e2 100644 --- a/src/uci/command.c +++ b/src/uci/command.c @@ -3,14 +3,10 @@ #include #include "uci/internals/command.h" -uci_cmd_t uci_cmd_init() { - uci_cmd_t output = {0}; - - output.empty = true; - output.args_capacity = 32; - output.args = calloc(sizeof(char) * MAX_TOKEN_SIZE, output.args_capacity); - - return output; +void uci_cmd_init(uci_cmd_t *cmd) { + cmd->empty = true; + cmd->args_capacity = 32; + cmd->args = calloc(sizeof(char) * MAX_TOKEN_SIZE, output.args_capacity); } bool is_valid_cmd(const char *token) { @@ -122,7 +118,8 @@ bool test_uci_cmd_t() { } bool test_invalid_cmd_uci_cmd_t() { - uci_cmd_t cmd = uci_cmd_init(); + uci_cmd_t cmd; + uci_cmd_init(&cmd); uci_cmd_add(&cmd, "john"); uci_cmd_add(&cmd, "debug"); -- cgit v1.2.3