From 9b5f99c37b4c48406eda5af2e58eb57b9a33c164 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 8 Sep 2010 10:44:23 -0400 Subject: Zero buffer data in BufAlloc() Inspired by a pattern in NoMachine's NX. Consistently zeroed buffers compress better with ssh and friends. Note that you'll need to rebuild all your protocol libraries to take advantage of this. Signed-off-by: Adam Jackson Reviewed-by: Jeremy Huddleston Reviewed-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/Xlibint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11') diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index e3d63f29a..ead343eae 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -617,7 +617,7 @@ extern void _XFlushGCCache(Display *dpy, GC gc); if (dpy->bufptr + (n) > dpy->bufmax) \ _XFlush (dpy); \ ptr = (type) dpy->bufptr; \ - (void)ptr; \ + memset(ptr, '\0', n); \ dpy->bufptr += (n); #define Data16(dpy, data, len) Data((dpy), (_Xconst char *)(data), (len)) -- cgit v1.2.3