From 3153ecf43ae517d7993fbaec317ada40d595850c Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 29 Jun 2017 15:19:04 +0300 Subject: [PATCH] fix byte referencing Signed-off-by: Vasiliy Tolstov --- client.go | 5 ++++- server.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index ace1b34..097357d 100644 --- a/client.go +++ b/client.go @@ -86,6 +86,9 @@ func (c *ClientConn) Close() error { close(c.quit) c.quit = nil } + if c.quitCh != nil { + close(c.quitCh) + } return c.c.Close() } @@ -111,7 +114,7 @@ func (c *ClientConn) PixelFormat() *PixelFormat { return c.pixelFormat } func (c *ClientConn) SetDesktopName(name []byte) { - c.desktopName = name + copy(c.desktopName, name) } func (c *ClientConn) SetPixelFormat(pf *PixelFormat) error { c.pixelFormat = pf diff --git a/server.go b/server.go index 135f3b0..bdb244b 100644 --- a/server.go +++ b/server.go @@ -94,7 +94,7 @@ func (c *ServerConn) PixelFormat() *PixelFormat { return c.pixelFormat } func (c *ServerConn) SetDesktopName(name []byte) { - c.desktopName = name + copy(c.desktopName, name) } func (c *ServerConn) SetPixelFormat(pf *PixelFormat) error { c.pixelFormat = pf