aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/XlibInt.c
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/src/XlibInt.c')
-rw-r--r--libX11/src/XlibInt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libX11/src/XlibInt.c b/libX11/src/XlibInt.c
index 498cf16be..33bbe5458 100644
--- a/libX11/src/XlibInt.c
+++ b/libX11/src/XlibInt.c
@@ -668,6 +668,7 @@ XAddConnectionWatch(
UnlockDisplay(dpy);
return 0;
}
+ info_list->watch_data = wd_array;
wd_array[dpy->watcher_count] = NULL; /* for cleanliness */
}
@@ -1444,9 +1445,10 @@ static int _XPrintDefaultError(
ext && (ext->codes.major_opcode != event->request_code);
ext = ext->next)
;
- if (ext)
- strcpy(buffer, ext->name);
- else
+ if (ext) {
+ strncpy(buffer, ext->name, BUFSIZ);
+ buffer[BUFSIZ - 1] = '\0';
+ } else
buffer[0] = '\0';
}
(void) fprintf(fp, " (%s)\n", buffer);