summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/connection.c2
-rw-r--r--os/io.c6
-rw-r--r--os/utils.c8
3 files changed, 10 insertions, 6 deletions
diff --git a/os/connection.c b/os/connection.c
index 4c749ff09..6982b1f10 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -911,7 +911,7 @@ ErrorConnMax(XtransConnInfo trans_conn)
{
int fd = _XSERVTransGetConnectionNumber (trans_conn);
xConnSetupPrefix csp;
- char pad[3];
+ char pad[3] = { 0, 0, 0 };
struct iovec iov[3];
char byteOrder = 0;
int whichbyte = 1;
diff --git a/os/io.c b/os/io.c
index b67a5f324..8d0e5cc6f 100644
--- a/os/io.c
+++ b/os/io.c
@@ -815,7 +815,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
NewOutputPending = TRUE;
FD_SET(oc->fd, &OutputPending);
memmove((char *) oco->buf + oco->count, buf, count);
- oco->count += count + padBytes;
+ oco->count += count;
+ if (padBytes) {
+ memset(oco->buf + oco->count, '\0', padBytes);
+ oco->count += padBytes;
+ }
return count;
}
diff --git a/os/utils.c b/os/utils.c
index 8355fafb4..e2486bb0c 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -763,10 +763,10 @@ ProcessCommandLine(int argc, char *argv[])
nolock = TRUE;
}
else if (strcmp(argv[i], "-nolisten") == 0) {
- if(++i < argc) {
- if (_XSERVTransNoListen(argv[i]))
- FatalError ("Failed to disable listen for %s transport",
- argv[i]);
+ if (++i < argc) {
+ if (_XSERVTransNoListen(argv[i]))
+ ErrorF("Failed to disable listen for %s transport",
+ argv[i]);
}
else
UseMsg();