Skip to content

Commit

Permalink
Merge branch 'contrib/github_pr_12507' into 'master'
Browse files Browse the repository at this point in the history
change(console): drop the use of open_memstream() (GitHub PR)

Closes IDFGH-11361

See merge request espressif/esp-idf!29878
  • Loading branch information
igrr committed Mar 28, 2024
2 parents 34f0a0d + 9370602 commit ac01077
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions components/console/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,10 @@ esp_err_t esp_console_cmd_register(const esp_console_cmd_t *cmd)
unused = asprintf(&item->hint, " %s", cmd->hint);
} else if (cmd->argtable) {
/* Generate hint based on cmd->argtable */
char *buf = NULL;
size_t buf_size = 0;
FILE *f = open_memstream(&buf, &buf_size);
if (f != NULL) {
arg_print_syntax(f, cmd->argtable, NULL);
fclose(f);
}
item->hint = buf;
arg_dstr_t ds = arg_dstr_create();
arg_print_syntax_ds(ds, cmd->argtable, NULL);
item->hint = strdup(arg_dstr_cstr(ds));
arg_dstr_destroy(ds);
}
item->argtable = cmd->argtable;

Expand Down

0 comments on commit ac01077

Please sign in to comment.