diff --git a/src/main.c b/src/main.c index d38da17b..c7bd3f79 100644 --- a/src/main.c +++ b/src/main.c @@ -610,6 +610,7 @@ real_main(int argc, char **argv) int i, restart=0; char *str, *alt; int d, s; + int flag; #ifdef DEBUG Bool doSync = False; #endif @@ -622,13 +623,16 @@ real_main(int argc, char **argv) str = wstrconcat("WMAKER_BIN_NAME=", argv[0]); putenv(str); - ArgCount = argc+1; - Arguments = wmalloc(sizeof(char*)*(ArgCount+2)); + flag= 0; + ArgCount = argc; + Arguments = wmalloc(sizeof(char*)*(ArgCount+1)); for (i= 0; i < argc; i++) - Arguments[i]= argv[i]; + { + Arguments[i]= argv[i]; + } /* add the extra option to signal that we're just restarting wmaker */ - Arguments[argc]= "--for-real="; - Arguments[argc+1]= NULL; + Arguments[argc-1]= "--for-real="; + Arguments[argc]= NULL; WMInitializeApplication("WindowMaker", &argc, argv); diff --git a/src/monitor.c b/src/monitor.c index 5a826b9d..69ceee63 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -94,7 +94,7 @@ int MonitorLoop(int argc, char **argv) char **child_argv= wmalloc(sizeof(char*)*(argc+2)); int i, status; time_t last_start; - + for (i= 0; i < argc; i++) child_argv[i]= argv[i]; child_argv[i++]= "--for-real"; @@ -123,9 +123,9 @@ int MonitorLoop(int argc, char **argv) wsyserror(_("Error during monitoring of Window Maker process.")); break; } - + child_argv[argc]= "--for-real-"; - + /* Check if the wmaker process exited due to a crash */ if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGSEGV ||