From 571089bceac205c3d5056fcb3f51c2d4b2d0592e Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Tue, 19 Feb 2013 14:30:32 +0000 Subject: viewer: exit when user specifies both -via and -listen parameters git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5048 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- vncviewer/vncviewer.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'vncviewer') diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 8e9622a5..6cf1d89f 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -444,7 +444,15 @@ int main(int argc, char** argv) Socket *sock = NULL; - if(listenMode) { + /* Specifying -via and -listen together is nonsense */ + if (listenMode && strlen(via.getValueStr()) > 0) { + vlog.error("Parameters -listen and -via are incompatible"); + fl_alert("Parameters -listen and -via are incompatible"); + exit_vncviewer(); + return 1; + } + + if (listenMode) { try { int port = 5500; if (isdigit(vncServerName[0])) -- cgit v1.2.3