aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-02-25 02:17:18 +0100
committerUlrich Sibiller <uli42@gmx.de>2017-03-02 12:22:40 +0100
commit3e315cd17a519dbcafff18d4294a6f7bb8070767 (patch)
treee8950e052bb5ee4328a052a9cf04efc847c47eff /nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
parent9d41e84ea9baf215c6de11224dc2597cd37359dc (diff)
downloadnx-libs-3e315cd17a519dbcafff18d4294a6f7bb8070767.tar.gz
nx-libs-3e315cd17a519dbcafff18d4294a6f7bb8070767.tar.bz2
nx-libs-3e315cd17a519dbcafff18d4294a6f7bb8070767.zip
Fix "uninitialised byte(s)" complaints from valgrind
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Clipboard.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 2e6f38efd..d26d3524a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -224,8 +224,6 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
void nxagentClearSelection(XEvent *X)
{
- xEvent x;
-
int i = 0;
#ifdef DEBUG
@@ -252,6 +250,8 @@ void nxagentClearSelection(XEvent *X)
{
if (lastSelectionOwner[i].client != NULL)
{
+ xEvent x;
+ memset(&x, 0, sizeof(xEvent));
x.u.u.type = SelectionClear;
x.u.selectionClear.time = GetTimeInMillis();
x.u.selectionClear.window = lastSelectionOwner[i].window;
@@ -315,6 +315,7 @@ FIXME: Do we need this?
XFree(strTarget);
}
*/
+ memset(&eventSelection, 0, sizeof(XSelectionEvent));
eventSelection.property = None;
if (X->xselectionrequest.target == serverTARGETS)
@@ -423,6 +424,7 @@ FIXME: Do we need this?
lastServerTime = X->xselectionrequest.time;
+ memset(&x, 0, sizeof(xEvent));
x.u.u.type = SelectionRequest;
x.u.selectionRequest.time = GetTimeInMillis();
x.u.selectionRequest.owner = lastSelectionOwner[i].window;
@@ -501,6 +503,7 @@ void nxagentSendSelectionNotify(Atom property)
lastClientClientPtr -> index);
#endif
+ memset(&x, 0, sizeof(xEvent));
x.u.u.type = SelectionNotify;
x.u.selectionNotify.time = lastClientTime;
@@ -980,6 +983,7 @@ void nxagentNotifySelection(XEvent *X)
}
+ memset(&eventSelection, 0, sizeof(XSelectionEvent));
eventSelection.type = SelectionNotify;
eventSelection.send_event = True;
eventSelection.display = nxagentDisplay;
@@ -1150,6 +1154,7 @@ FIXME: Why this pointer can be not a valid
return;
}
+ memset(&x, 0, sizeof(xEvent));
x.u.u.type = SelectionNotify;
x.u.selectionNotify.time = time;
x.u.selectionNotify.requestor = requestor;
@@ -1255,6 +1260,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
4,
&xa_STRING, 1);
+ memset(&x, 0, sizeof(xEvent));
x.u.u.type = SelectionNotify;
x.u.selectionNotify.time = time;
x.u.selectionNotify.requestor = requestor;
@@ -1287,6 +1293,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
(unsigned char *) &lastSelectionOwner[i].lastTimeChanged,
1);
+ memset(&x, 0, sizeof(xEvent));
x.u.u.type = SelectionNotify;
x.u.selectionNotify.time = time;
x.u.selectionNotify.requestor = requestor;
@@ -1375,6 +1382,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
"to the requestor with property None.\n");
#endif
+ memset(&x, 0, sizeof(xEvent));
x.u.u.type = SelectionNotify;
x.u.selectionNotify.time = time;
x.u.selectionNotify.requestor = requestor;
@@ -1407,6 +1415,7 @@ int nxagentSendNotify(xEvent *event)
* Setup selection notify event to real server.
*/
+ memset(&x, 0, sizeof(XSelectionEvent));
x.type = SelectionNotify;
x.send_event = True;
x.display = nxagentDisplay;