From: Brian Hinz Date: Fri, 11 Nov 2011 19:12:33 +0000 (+0000) Subject: java client should accept server port specified as either rfb port or display offset... X-Git-Tag: v1.1.90~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9b7b087a2d7dcea0967f2c481577d15ac371aed4;p=tigervnc.git java client should accept server port specified as either rfb port or display offset. Credit to Dan Garton for pointing this out. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4796 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/java/com/tigervnc/rfb/Hostname.java b/java/com/tigervnc/rfb/Hostname.java index 42fda537..3821c219 100644 --- a/java/com/tigervnc/rfb/Hostname.java +++ b/java/com/tigervnc/rfb/Hostname.java @@ -36,6 +36,9 @@ public class Hostname { if (vncServerName.charAt(colonPos+1) == ':') { return Integer.parseInt(vncServerName.substring(colonPos+2)); } - return Integer.parseInt(vncServerName.substring(colonPos+1)) + 5900; + int port = Integer.parseInt(vncServerName.substring(colonPos+1)); + if (port < 100) + port += 5900; + return port; } }