X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fapple2-main.c;h=dc42ae981dd36f06136a6295866429ee093d7d25;hp=28fef9aa446cfc77a3ea5e890ecbb299f8495004;hb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439 diff --git a/hacks/apple2-main.c b/hacks/apple2-main.c index 28fef9aa..dc42ae98 100644 --- a/hacks/apple2-main.c +++ b/hacks/apple2-main.c @@ -27,6 +27,7 @@ #ifndef HAVE_COCOA # define XK_MISCELLANY # include +# include # include # include #endif @@ -943,7 +944,10 @@ terminal_read(struct terminal_controller_data *mine, unsigned char *buf, int n) return 1; } - if (!mine->input_available_p) return 0; + if (!mine || + !mine->input_available_p || + !mine->pipe) + return 0; rc=read (fileno (mine->pipe), (void *) buf, n); if (rc>0) mine->lastc=buf[rc-1];