From 893d360a5526f048aa0c7946c8145f823f3e9e3d Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Tue, 7 Apr 2020 12:29:58 +0300 Subject: [PATCH] Argv shenanigans --- c/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/c/main.c b/c/main.c index 935aa08..c848fd4 100644 --- a/c/main.c +++ b/c/main.c @@ -220,17 +220,18 @@ static const char **parse_command_line_flags(const char **argv) int main(int argc, char **argv) { + const char **cargv = (const char **)argv; const char **command_line; - command_line = parse_command_line_flags((const char **)(argv + 1)); + command_line = parse_command_line_flags(cargv + 1); if (helpflag) { generic_usage(stdout, 0); } fl_init(512 * 1024); { fl_gc_handle(&os_command_line); - os_command_line = argv_list(argc, (const char **)argv); - command_line_offset = (command_line - (const char **)argv) / sizeof(*argv); + os_command_line = argv_list(argc, cargv); + command_line_offset = (command_line - cargv) / sizeof(*cargv); FL_TRY_EXTERN { if (versionflag) {