vere: copy argv[0] before calling dirname()

This commit is contained in:
Joe Bryan 2022-05-18 21:59:08 -04:00
parent a9233493d3
commit c70e8ed167

View File

@ -361,7 +361,9 @@ _main_getopt(c3_i argc, c3_c** argv)
if ( (U3_BIN_ALIAS_LEN <= len_w)
&& (0 == strcmp(argv[0] + (len_w - U3_BIN_ALIAS_LEN), U3_BIN_ALIAS)) )
{
u3_Host.dir_c = _main_repath(dirname(argv[0]));
c3_c* bin_c = strdup(argv[0]);
u3_Host.dir_c = _main_repath(dirname(bin_c));
c3_free(bin_c);
}
// no args, invalid command
//