From 58445c9abf1ae1093e8105a53418c070152859eb Mon Sep 17 00:00:00 2001 From: Ulrich Czekalla Date: Sat, 25 Nov 2000 01:26:02 +0000 Subject: [PATCH] Allow for zero-length string selections. --- windows/x11drv/clipboard.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/windows/x11drv/clipboard.c b/windows/x11drv/clipboard.c index 1440456e581..8434793dcff 100644 --- a/windows/x11drv/clipboard.c +++ b/windows/x11drv/clipboard.c @@ -527,11 +527,10 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At for(i=0; i <= nitems; i++) if( val[i] == '\n' ) inlcount++; - if( nitems ) - { hText=GlobalAlloc16(GMEM_MOVEABLE, nitems + inlcount + 1); if( (lpstr = (char*)GlobalLock16(hText)) ) { + ZeroMemory(lpstr, nitems + inlcount + 1); for(i=0,inlcount=0; i <= nitems; i++) { if( val[i] == '\n' ) lpstr[inlcount++]='\r'; @@ -541,7 +540,6 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At } else hText = 0; - } if( hText ) {