From 42dca922d287ffddcf2185ca96738f1505a04c27 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 30 Apr 2009 14:50:08 +1000 Subject: [PATCH] If there's multiple null-terminated strings in the property, print all. Signed-off-by: Peter Hutterer Signed-off-by: Simon Thum --- src/property.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/property.c b/src/property.c index e84a570..a21edc6 100644 --- a/src/property.c +++ b/src/property.c @@ -98,8 +98,17 @@ print_property(Display *dpy, XDevice* dev, Atom property) } break; case XA_STRING: + if (act_format != 8) + { + printf("Unknown string format.\n"); + done = True; + break; + } printf("\"%s\"", ptr); - done = True; + j += strlen((char*)ptr); /* The loop's j++ jumps over the + terminating 0 */ + ptr += strlen((char*)ptr); /* ptr += size below jumps over + the terminating 0 */ break; case XA_ATOM: printf("\"%s\"", XGetAtomName(dpy, *(Atom*)ptr)); -- 2.56.0