aboutsummaryrefslogtreecommitdiff
path: root/apps/xwininfo/dsimple.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-06-10 10:26:07 +0200
committermarha <marha@users.sourceforge.net>2011-06-10 10:26:07 +0200
commit01b6bb489cc42ea112ed91dd1f2aeb90bc8e212b (patch)
tree1861405ebb9a51951bf16fd1d81ea95c61b6039f /apps/xwininfo/dsimple.c
parent4cf8ef726ac1678d54aafde0375fc531f065ebb2 (diff)
parentee6b5ca3b101697d067675efa68f0e603cd61ffa (diff)
downloadvcxsrv-01b6bb489cc42ea112ed91dd1f2aeb90bc8e212b.tar.gz
vcxsrv-01b6bb489cc42ea112ed91dd1f2aeb90bc8e212b.tar.bz2
vcxsrv-01b6bb489cc42ea112ed91dd1f2aeb90bc8e212b.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/xkeyboard-config/configure.in xorg-server/xkeyboard-config/rules/Makefile.am
Diffstat (limited to 'apps/xwininfo/dsimple.c')
-rw-r--r--apps/xwininfo/dsimple.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/xwininfo/dsimple.c b/apps/xwininfo/dsimple.c
index 36ee5c29a..63260661c 100644
--- a/apps/xwininfo/dsimple.c
+++ b/apps/xwininfo/dsimple.c
@@ -254,7 +254,8 @@ recursive_Window_With_Name (
xcb_connection_t *dpy,
xcb_window_t window,
struct wininfo_cookies *cookies,
- const char *name)
+ const char *name,
+ size_t namelen)
{
xcb_window_t *children;
unsigned int nchildren;
@@ -274,7 +275,8 @@ recursive_Window_With_Name (
int prop_name_len = xcb_get_property_value_length (prop);
/* can't use strcmp, since prop.name is not null terminated */
- if (strncmp (prop_name, name, prop_name_len) == 0) {
+ if ((namelen == prop_name_len) &&
+ memcmp (prop_name, name, namelen) == 0) {
w = window;
}
}
@@ -295,7 +297,8 @@ recursive_Window_With_Name (
if (xcb_get_wm_name_reply (dpy, cookies->get_wm_name,
&nameprop, &err)) {
/* can't use strcmp, since nameprop.name is not null terminated */
- if (strncmp (nameprop.name, name, nameprop.name_len) == 0) {
+ if ((namelen == nameprop.name_len) &&
+ memcmp (nameprop.name, name, namelen) == 0) {
w = window;
}
@@ -310,7 +313,8 @@ recursive_Window_With_Name (
int prop_name_len = xcb_get_property_value_length (prop);
/* can't use strcmp, since prop.name is not null terminated */
- if (strncmp (prop_name, name, prop_name_len) == 0) {
+ if ((namelen == prop_name_len) &&
+ memcmp (prop_name, name, namelen) == 0) {
w = window;
}
}
@@ -355,7 +359,7 @@ recursive_Window_With_Name (
for (i = 0; i < nchildren; i++) {
w = recursive_Window_With_Name (dpy, children[i],
- &child_cookies[i], name);
+ &child_cookies[i], name, namelen);
if (w)
break;
}
@@ -393,7 +397,7 @@ Window_With_Name (
cookies.get_wm_name = xcb_get_wm_name (dpy, top);
cookies.query_tree = xcb_query_tree (dpy, top);
xcb_flush (dpy);
- return recursive_Window_With_Name(dpy, top, &cookies, name);
+ return recursive_Window_With_Name(dpy, top, &cookies, name, strlen(name));
}