]> code.delx.au - gnu-emacs/commitdiff
Fix a crash in emacsclient when DISPLAY is unset.
authorKaroly Lorentey <lorentey@elte.hu>
Fri, 20 Feb 2004 23:54:53 +0000 (23:54 +0000)
committerKaroly Lorentey <lorentey@elte.hu>
Fri, 20 Feb 2004 23:54:53 +0000 (23:54 +0000)
lib-src/emacsclient.c (decode_options): Don't call strlen on a null
pointer. Reported by Ami Fishman.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-92

lib-src/emacsclient.c

index 1ef45481840e5d214e72c9389cd934edcc64ceb6..f41315b1248fd57dad54660adba763f5c2a09c0f 100644 (file)
@@ -112,7 +112,7 @@ decode_options (argc, argv)
 {
   alternate_editor = getenv ("ALTERNATE_EDITOR");
   display = getenv ("DISPLAY");
-  if (strlen (display) == 0)
+  if (display && strlen (display) == 0)
     display = NULL;
   
   if (display)