Commit c7c1461b authored by Sergei Golubchik's avatar Sergei Golubchik

fix embedded startup with no command line arguments

&fake_argv cannot be cast to char***
this causes a crash when resolving
parent cfb47ddd
......@@ -518,7 +518,6 @@ int init_embedded_server(int argc, char **argv, char **groups)
*/
int *argcp;
char ***argvp;
int fake_argc = 1;
char *fake_argv[] = { (char *)"", 0 };
const char *fake_groups[] = { "server", "embedded", 0 };
my_bool acl_error;
......@@ -531,16 +530,14 @@ int init_embedded_server(int argc, char **argv, char **groups)
if (init_early_variables())
return 1;
if (argc)
if (!argc)
{
argcp= &argc;
argvp= (char***) &argv;
}
else
{
argcp= &fake_argc;
argvp= (char ***) &fake_argv;
argc= 1;
argv= fake_argv;
}
argcp= &argc;
argvp= &argv;
if (!groups)
groups= (char**) fake_groups;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment