| Re: [Freeciv-Dev] New bug at latest CVS.[Top] [All Lists][Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
 >  GTK-client crashes when server shuts down.
> With my amiga it says:
>  "couldn't open logfile:<some random characters> for appending."
> 
> It doesn't matter if I have actually enabled logging or not.
I almost sure I'm the creator of this bug.
So try this patch and give me feedback.
Bye,
Index: client/gui-gtk/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gui_main.c,v
retrieving revision 1.40
diff -u -r1.40 gui_main.c
--- gui_main.c  1999/08/10 08:07:44     1.40
+++ gui_main.c  1999/08/10 19:54:12
@@ -182,7 +182,7 @@
 **************************************************************************/
 static void parse_options(int argc, char **argv)
 {
-  char logfile[512]="";
+  char *logfile=NULL;
   char *option=NULL; /* really use as a pointer */
   int loglevel;
   int i;
@@ -221,7 +221,7 @@
       exit(0);
       }
     else if ((option = get_option("--log",argv,&i,argc)) != NULL)
-      strcpy(logfile,option);
+      logfile = strdup(option);
     else if ((option = get_option("--name",argv,&i,argc)) != NULL)
       strcpy(name, option);
     else if ((option = get_option("--port",argv,&i,argc)) != NULL)
 
 |  |