From: Paul Eggert Date: Sat, 2 Apr 2011 02:06:43 +0000 (-0700) Subject: * xfns.c (make_invisible_cursor): Don't return garbage X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~394^2~63 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8664db062341eee9a363de0c37b6fa017a42511b;p=emacs.git * xfns.c (make_invisible_cursor): Don't return garbage if XCreateBitmapFromData fails. --- diff --git a/src/ChangeLog b/src/ChangeLog index 17cc06bfe32..b2a337b1878 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-04-02 Paul Eggert + * xfns.c (make_invisible_cursor): Don't return garbage + if XCreateBitmapFromData fails. + * xselect.c (x_get_local_selection, x_handle_property_notify): Remove vars that are set but not used. diff --git a/src/xfns.c b/src/xfns.c index 39c77b8c8c7..8e5639681df 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -855,19 +855,20 @@ make_invisible_cursor (struct frame *f) static char const no_data[] = { 0 }; Pixmap pix; XColor col; - Cursor c; + Cursor c = 0; x_catch_errors (dpy); pix = XCreateBitmapFromData (dpy, FRAME_X_DISPLAY_INFO (f)->root_window, no_data, 1, 1); if (! x_had_errors_p (dpy) && pix != None) { + Cursor pixc; col.pixel = 0; col.red = col.green = col.blue = 0; col.flags = DoRed | DoGreen | DoBlue; - c = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0); - if (x_had_errors_p (dpy) || c == None) - c = 0; + pixc = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0); + if (! x_had_errors_p (dpy) && pixc != None) + c = pixc; XFreePixmap (dpy, pix); }