]> diplodocus.org Git - xorg-xinput/commitdiff
If there's multiple null-terminated strings in the property, print all.
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 30 Apr 2009 04:50:08 +0000 (14:50 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 30 Apr 2009 23:32:22 +0000 (09:32 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Simon Thum <simon.thum@gmx.de>
src/property.c

index e84a570..a21edc6 100644 (file)
@@ -98,8 +98,17 @@ print_property(Display *dpy, XDevice* dev, Atom property)
                     }
                     break;
                 case XA_STRING:
                     }
                     break;
                 case XA_STRING:
+                    if (act_format != 8)
+                    {
+                        printf("Unknown string format.\n");
+                        done = True;
+                        break;
+                    }
                     printf("\"%s\"", ptr);
                     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));
                     break;
                 case XA_ATOM:
                     printf("\"%s\"", XGetAtomName(dpy, *(Atom*)ptr));