From 59cac9c0cce20a429c9f5e7cb6bb24c0e71a318c Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 24 Jan 2019 10:40:52 +0100 Subject: [PATCH] change spice port type to unsigned short so that ports >32767 get displayed correctly, also signed overflow is undefined behaviour Signed-off-by: Dominik Csapak --- client/spice/spice.c | 2 +- client/spice/spice.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/spice/spice.c b/client/spice/spice.c index 3572fe16..4a33c0fb 100644 --- a/client/spice/spice.c +++ b/client/spice/spice.c @@ -138,7 +138,7 @@ bool spice_discard (const struct SpiceChannel * channel, ssize_t size); // ============================================================================ -bool spice_connect(const char * host, const short port, const char * password) +bool spice_connect(const char * host, const unsigned short port, const char * password) { strncpy(spice.password, password, sizeof(spice.password) - 1); memset(&spice.addr, 0, sizeof(spice.addr)); diff --git a/client/spice/spice.h b/client/spice/spice.h index 47aea54f..588507b4 100644 --- a/client/spice/spice.h +++ b/client/spice/spice.h @@ -21,7 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include #include -bool spice_connect(const char * host, const short port, const char * password); +bool spice_connect(const char * host, const unsigned short port, const char * password); void spice_disconnect(); bool spice_process(); bool spice_ready();