summaryrefslogtreecommitdiffstats
path: root/x11vnc/pointer.c
diff options
context:
space:
mode:
authorrunge <runge>2006-07-04 23:47:28 +0000
committerrunge <runge>2006-07-04 23:47:28 +0000
commit06af02b5accbe88a7fad28dceae5b85a0f11e4ad (patch)
tree9f2efce1b6b871a10d3d8865753dc4bafda84cee /x11vnc/pointer.c
parent93ca945acb85760ce3661debf5badb570ffe0454 (diff)
downloadlibtdevnc-06af02b5accbe88a7fad28dceae5b85a0f11e4ad.tar.gz
libtdevnc-06af02b5accbe88a7fad28dceae5b85a0f11e4ad.zip
x11vnc: check all XKeysymToString() return values.
Diffstat (limited to 'x11vnc/pointer.c')
-rw-r--r--x11vnc/pointer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/x11vnc/pointer.c b/x11vnc/pointer.c
index 0b7cece..a5896cb 100644
--- a/x11vnc/pointer.c
+++ b/x11vnc/pointer.c
@@ -121,6 +121,7 @@ static void buttonparse(int from, char **s) {
/*
* XXX may not work with -modtweak or -xkb
*/
+ char *str;
X_LOCK;
kcode = XKeysymToKeycode(dpy, ksym);
@@ -143,9 +144,10 @@ static void buttonparse(int from, char **s) {
modisdown[kcode] = 1;
}
}
+ str = XKeysymToString(ksym);
rfbLog(" event %d: keysym %s (0x%x) -> "
"keycode 0x%x down=%d up=%d\n", n+1,
- XKeysymToString(ksym), ksym, kcode,
+ str ? str : "null", ksym, kcode,
pointer_map[from][n].down,
pointer_map[from][n].up);
X_UNLOCK;
@@ -364,13 +366,13 @@ void do_button_mask_change(int mask, int button) {
continue;
}
if (debug_pointer && dpy) {
+ char *str = XKeysymToString(XKeycodeToKeysym(
+ dpy, key, 0));
rfbLog("pointer(): sending button %d "
"down as keycode 0x%x (event %d)\n",
i+1, key, k+1);
- rfbLog(" down=%d up=%d "
- "keysym: %s\n", down, up,
- XKeysymToString(XKeycodeToKeysym(
- dpy, key, 0)));
+ rfbLog(" down=%d up=%d keysym: "
+ "%s\n", down, up, str ? str : "null");
}
if (down) {
XTestFakeKeyEvent_wr(dpy, key, True,