diff options
author | Pierre Ossman <ossman@cendio.se> | 2016-07-11 09:44:14 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2016-07-11 09:44:14 +0200 |
commit | 7caaea10402e3d00d2e1c2e6d233b64b0a71273a (patch) | |
tree | d12e2d24247dcb441d8a1f88cf5b757c9d6616af | |
parent | 296630f586e42d3cdf951f3512a731a5b682af4c (diff) | |
download | tigervnc-7caaea10402e3d00d2e1c2e6d233b64b0a71273a.tar.gz tigervnc-7caaea10402e3d00d2e1c2e6d233b64b0a71273a.zip |
Fix display/port switch at display 100
168b92c broke the handling that assumes display 100 and above are
actually a port number.
-rw-r--r-- | common/rfb/Hostname.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/common/rfb/Hostname.h b/common/rfb/Hostname.h index 02c51a61..bd68dc02 100644 --- a/common/rfb/Hostname.h +++ b/common/rfb/Hostname.h @@ -84,17 +84,14 @@ namespace rfb { throw rdr::Exception("invalid port specified"); if (portStart[1] != ':') - portStart += 1; - else { - portStart += 2; - basePort = 0; - } - - *port = strtol(portStart, &end, 10); + *port = strtol(portStart + 1, &end, 10); + else + *port = strtol(portStart + 2, &end, 10); if (*end != '\0') throw rdr::Exception("invalid port specified"); - *port += basePort; + if ((portStart[1] != ':') && (*port < 100)) + *port += basePort; } } |