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) ...@@ -518,7 +518,6 @@ int init_embedded_server(int argc, char **argv, char **groups)
*/ */
int *argcp; int *argcp;
char ***argvp; char ***argvp;
int fake_argc = 1;
char *fake_argv[] = { (char *)"", 0 }; char *fake_argv[] = { (char *)"", 0 };
const char *fake_groups[] = { "server", "embedded", 0 }; const char *fake_groups[] = { "server", "embedded", 0 };
my_bool acl_error; my_bool acl_error;
...@@ -531,16 +530,14 @@ int init_embedded_server(int argc, char **argv, char **groups) ...@@ -531,16 +530,14 @@ int init_embedded_server(int argc, char **argv, char **groups)
if (init_early_variables()) if (init_early_variables())
return 1; return 1;
if (argc) if (!argc)
{ {
argcp= &argc; argc= 1;
argvp= (char***) &argv; argv= fake_argv;
}
else
{
argcp= &fake_argc;
argvp= (char ***) &fake_argv;
} }
argcp= &argc;
argvp= &argv;
if (!groups) if (!groups)
groups= (char**) fake_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