From: Peter Hutterer Date: Wed, 20 May 2009 02:02:31 +0000 (+1000) Subject: Deal with None atoms. X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/aae3bfee098567a80444b970aea4c737c736254c?hp=4832dc1f3ee8d11eadc99b5cd4e8158773d11f9b Deal with None atoms. An atom may in some cases be 0 (None). Deal with this instead of failing with BadAtom values. Signed-off-by: Peter Hutterer --- diff --git a/src/property.c b/src/property.c index db46059..86c1608 100644 --- a/src/property.c +++ b/src/property.c @@ -111,8 +111,13 @@ print_property(Display *dpy, XDevice* dev, Atom property) 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) {