<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- a/libcli.c
+++ b/libcli.c
@@ -427,7 +427,7 @@ struct cli_command *cli_register_command
   struct cli_command *c;
 
   if (!command) return NULL;
-  if (!(c = calloc(sizeof(struct cli_command), 1))) return NULL;
+  if (!(c = calloc(1, sizeof(struct cli_command)))) return NULL;
   c-&gt;command_type = CLI_REGULAR_COMMAND;
   c-&gt;callback = callback;
   c-&gt;next = NULL;
@@ -597,10 +597,10 @@ struct cli_def *cli_init() {
   struct cli_def *cli;
   struct cli_command *c;
 
-  if (!(cli = calloc(sizeof(struct cli_def), 1))) return 0;
+  if (!(cli = calloc(1, sizeof(struct cli_def)))) return 0;
 
   cli-&gt;buf_size = 1024;
-  if (!(cli-&gt;buffer = calloc(cli-&gt;buf_size, 1))) {
+  if (!(cli-&gt;buffer = calloc(1, cli-&gt;buf_size))) {
     cli_done(cli);
     return 0;
   }
@@ -778,7 +778,7 @@ static char *cli_int_return_newword(cons
 
   // allocate space (including terminal NULL, then go through and deal with escaping characters as we copy them
 
-  if (!(newword = calloc(len + 1, 1))) return 0;
+  if (!(newword = calloc(1, len + 1))) return 0;
   to = newword;
   while (start != end) {
     if (*start == '\\')
@@ -1940,7 +1940,7 @@ int cli_match_filter_init(struct cli_def
   char *search_flags = cli_get_optarg_value(cli, "search_flags", NULL);
 
   filt-&gt;filter = cli_match_filter;
-  filt-&gt;data = state = calloc(sizeof(struct cli_match_filter_state), 1);
+  filt-&gt;data = state = calloc(1, sizeof(struct cli_match_filter_state));
   if (!state) return CLI_ERROR;
 
   if (!strcmp(cli-&gt;pipeline-&gt;current_stage-&gt;words[0], "include")) {
@@ -2033,7 +2033,7 @@ int cli_range_filter_init(struct cli_def
   //    from the command line processing and continue
 
   filt-&gt;filter = cli_range_filter;
-  filt-&gt;data = state = calloc(sizeof(struct cli_range_filter_state), 1);
+  filt-&gt;data = state = calloc(1, sizeof(struct cli_range_filter_state));
   if (state) {
     state-&gt;from = from;
     state-&gt;to = to;
@@ -2070,7 +2070,7 @@ int cli_count_filter_init(struct cli_def
   }
 
   filt-&gt;filter = cli_count_filter;
-  if (!(filt-&gt;data = calloc(sizeof(int), 1))) return CLI_ERROR;
+  if (!(filt-&gt;data = calloc(1, sizeof(int)))) return CLI_ERROR;
 
   return CLI_OK;
 }
@@ -2127,7 +2127,7 @@ struct cli_command *cli_register_filter(
   struct cli_command *c;
 
   if (!command) return NULL;
-  if (!(c = calloc(sizeof(struct cli_command), 1))) return NULL;
+  if (!(c = calloc(1, sizeof(struct cli_command)))) return NULL;
 
   c-&gt;command_type = CLI_FILTER_COMMAND;
   c-&gt;init = init;
@@ -2239,7 +2239,7 @@ struct cli_optarg *cli_register_optarg(s
       goto CLEANUP;
     }
   }
-  if (!(optarg = calloc(sizeof(struct cli_optarg), 1))) goto CLEANUP;
+  if (!(optarg = calloc(1, sizeof(struct cli_optarg)))) goto CLEANUP;
   if (!(optarg-&gt;name = strdup(name))) goto CLEANUP;
   if (help &amp;&amp; !(optarg-&gt;help = strdup(help))) goto CLEANUP;
 
@@ -2505,7 +2505,7 @@ struct cli_command *cli_int_register_bui
   struct cli_command *c;
 
   if (!command) return NULL;
-  if (!(c = calloc(sizeof(struct cli_command), 1))) return NULL;
+  if (!(c = calloc(1, sizeof(struct cli_command)))) return NULL;
 
   c-&gt;flags = flags;
   c-&gt;callback = callback;
@@ -3068,7 +3068,7 @@ int cli_int_execute_pipeline(struct cli_
     struct cli_pipeline_stage *stage = &amp;pipeline-&gt;stage[stage_num];
     pipeline-&gt;current_stage = stage;
     cli-&gt;found_optargs = stage-&gt;found_optargs;
-    *filt = calloc(sizeof(struct cli_filter), 1);
+    *filt = calloc(1, sizeof(struct cli_filter));
     if (*filt) {
       if ((rc = stage-&gt;command-&gt;init(cli, stage-&gt;num_words, stage-&gt;words, *filt) != CLI_OK)) {
         break;
</pre></body></html>