]> diplodocus.org Git - xorg-xinput/commitdiff
Deal with None atoms.
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 20 May 2009 02:02:31 +0000 (12:02 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 20 May 2009 02:10:37 +0000 (12:10 +1000)
An atom may in some cases be 0 (None). Deal with this instead of failing with
BadAtom values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/property.c

index db46059e6edf8ab43b5e0d61448ef55ccfbcc6a5..86c160867abef70229c8cd2bab6ae9f9692aad86 100644 (file)
@@ -111,8 +111,13 @@ print_property(Display *dpy, XDevice* dev, Atom property)
                                                   the terminating 0 */
                     break;
                 case XA_ATOM:
                                                   the terminating 0 */
                     break;
                 case XA_ATOM:
-                    printf("\"%s\"", XGetAtomName(dpy, *(Atom*)ptr));
-                    break;
+                    {
+                        Atom a = *(Atom*)ptr;
+                        printf("\"%s\" (%d)",
+                                (a) ? XGetAtomName(dpy, a) : "None",
+                                (int)a);
+                        break;
+                    }
                 default:
                     if (float_atom != None && act_type == float_atom)
                     {
                 default:
                     if (float_atom != None && act_type == float_atom)
                     {