Skip to content

Commit

Permalink
Fix lib/subcommands.c sprintf usage. (#520)
Browse files Browse the repository at this point in the history
As sprintf gets deprecated, update sources to use snprintf.
  • Loading branch information
dimitri authored Oct 30, 2023
1 parent f92b03a commit 0557802
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bin/lib/subcommands.c/commandline.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,8 @@ commandline_add_breadcrumb(CommandLine *command, CommandLine *subcommand)
breadcrumbLength += subcommandLength + 2;

subcommand->breadcrumb = (char *) malloc(breadcrumbLength * sizeof(char));
sprintf(subcommand->breadcrumb, "%s %s", command_bc, subcommand->name);

snprintf(subcommand->breadcrumb, breadcrumbLength, "%s %s",
command_bc,
subcommand->name);
}

0 comments on commit 0557802

Please sign in to comment.