Signed-off-by: Alan Coopersmith <[email protected]>
---
src/dmx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/dmx.c b/src/dmx.c
index 5ef0ed4..7e1f953 100644
--- a/src/dmx.c
+++ b/src/dmx.c
@@ -440,8 +440,7 @@ Bool DMXAddScreen(Display *dpy, const char *displayName,
unsigned int mask,
req->length += _DMXDumpScreenAttributes(dpy, mask, attr);
if (length) {
- char *buffer = Xmalloc(paddedLength);
- memset(buffer, 0, paddedLength);
+ char *buffer = Xcalloc(paddedLength, 1);
memcpy(buffer, displayName, length);
Data32(dpy, buffer, paddedLength);
Xfree(buffer);
@@ -780,8 +779,7 @@ Bool DMXAddInput(Display *dpy, unsigned int mask,
DMXInputAttributes *attr,
req->length += _DMXDumpInputAttributes(dpy, mask, attr);
if (length) {
- char *buffer = Xmalloc(paddedLength);
- memset(buffer, 0, paddedLength);
+ char *buffer = Xcalloc(paddedLength, 1);
memcpy(buffer, attr->name, paddedLength);
Data32(dpy, buffer, paddedLength);
Xfree(buffer);
--
1.7.9.2
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel