diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-15 13:55:35 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-15 13:55:35 +0530 |
| commit | 378cc549ab442c845ac9d62cc8cef6977073fe4d (patch) | |
| tree | 83b4575d7ad80cdd4f694f596f5655e164e0478f /src/uci | |
| parent | 7d36403836511ab0745791ce98498cf5112633c1 (diff) | |
md files
Diffstat (limited to 'src/uci')
| -rw-r--r-- | src/uci/command.c | 15 |
1 files changed, 6 insertions, 9 deletions
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 <stdlib.h> #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"); |
