[Freeciv-Dev] [patch] segfault on bad DISPLAY variable
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, 15 Jan 1999, Nicolas BRUNEL wrote:
> Display *d;
>
> if ((d = XOpenDisplay(getenv("DISPLAY"))) == NULL) {
> fprintf(stderr,"Can't open display\n");
> exit(1); }
> else XtVaAppInitialize ...
That works. No more segfault. Here is a patch.
Yours,
Per
--- xmain.c.old Thu Jan 28 12:24:33 1999
+++ xmain.c Thu Jan 28 12:30:48 1999
@@ -262,5 +262,9 @@
/* XtSetLanguageProc(NULL, (XtLanguageProc)NULL, NULL); */
- toplevel = XtVaAppInitialize(
+ Display *d;
+ if ((d = XOpenDisplay(getenv("DISPLAY"))) == NULL) {
+ fprintf(stderr, "Can't open X-Windows display.\n");
+ exit(1);
+ } else toplevel = XtVaAppInitialize(
&app_context, /* Application context */
"Freeciv", /* application class name */
|
|