From 3825ed9fb99d0626c57deffe19b825e9619fafe4 Mon Sep 17 00:00:00 2001
From: dscho <dscho>
Date: Mon, 26 Nov 2001 17:06:39 +0000
Subject: no crash when display was wrong

---
 TODO     | 3 ++-
 x11vnc.c | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/TODO b/TODO
index 8fa28ab..2ced4f5 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,8 @@
 immediate:
 ----------
 
-x11vnc: clipboard, cursor, updates interruptible by input
+x11vnc: clipboard, cursor, updates interruptible by input,
+	sometimes XTest fails (but doesn't with x0rfbserver)
 extra_bytes in rfbDrawCharWithClip.
 tested mouse buttons make copy rect, but text is not marked as mod.
 cursor drawing: set optional grain to mark bigger rectangles as drawn (else
diff --git a/x11vnc.c b/x11vnc.c
index 394631f..aaa4d27 100644
--- a/x11vnc.c
+++ b/x11vnc.c
@@ -243,6 +243,11 @@ int main(int argc,char** argv)
 
   if(dpy==0)
     dpy = XOpenDisplay("");
+  if(dpy==0) {
+    fprintf(stderr,"Couldn't open display!\n");
+    exit(2);
+  }
+     
   xscreen = DefaultScreen(dpy);
 
   init_keycodes();
-- 
cgit v1.2.3

