From aae3bfee098567a80444b970aea4c737c736254c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 May 2009 12:02:31 +1000 Subject: [PATCH] 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 --- src/property.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) { -- 2.56.0