Fix a crash in emacsclient when DISPLAY is unset.

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
This commit is contained in:
Karoly Lorentey 2004-02-20 23:54:53 +00:00
parent 4f6b8a07a3
commit 8689463ae0

View 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)