summaryrefslogtreecommitdiffstats
path: root/src/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/parse.c b/src/parse.c
index 5c55076..64e08cd 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -3666,14 +3666,11 @@ struct bfs_ctx *bfs_parse_cmdline(int argc, char *argv[]) {
}
ctx->argc = argc;
- ctx->argv = malloc((argc + 1)*sizeof(*ctx->argv));
+ ctx->argv = xmemdup(argv, sizeof_array(char *, argc + 1));
if (!ctx->argv) {
- perror("malloc()");
+ perror("xmemdup()");
goto fail;
}
- for (int i = 0; i <= argc; ++i) {
- ctx->argv[i] = argv[i];
- }
enum use_color use_color = COLOR_AUTO;
if (getenv("NO_COLOR")) {