aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/ServerDialog.cxx
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2013-01-23 13:55:46 +0000
committerAdam Tkac <atkac@redhat.com>2013-01-23 13:55:46 +0000
commit8ac4b30fe93c7bd0ce54e0d5caebce82151393bd (patch)
treea0b3953b575959706f1c6980ad9c43828075fc34 /vncviewer/ServerDialog.cxx
parente7370bd3dc96c68dc078d914cc5085795798d0ce (diff)
downloadtigervnc-8ac4b30fe93c7bd0ce54e0d5caebce82151393bd.tar.gz
tigervnc-8ac4b30fe93c7bd0ce54e0d5caebce82151393bd.zip
Re-add the "-via" parameter support on UNIX platforms.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5032 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/ServerDialog.cxx')
-rw-r--r--vncviewer/ServerDialog.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/vncviewer/ServerDialog.cxx b/vncviewer/ServerDialog.cxx
index 25a010a1..4cf35353 100644
--- a/vncviewer/ServerDialog.cxx
+++ b/vncviewer/ServerDialog.cxx
@@ -107,23 +107,22 @@ ServerDialog::~ServerDialog()
}
-const char *ServerDialog::run(const char* servername)
+void ServerDialog::run(const char* servername, char *newservername)
{
ServerDialog dialog;
- static char buffer[256];
dialog.serverName->value(servername);
dialog.show();
while (dialog.shown()) Fl::wait();
- if (dialog.serverName->value() == NULL)
- return NULL;
-
- strncpy(buffer, dialog.serverName->value(), sizeof(buffer));
- buffer[sizeof(buffer)-1] = '\0';
+ if (dialog.serverName->value() == NULL) {
+ newservername[0] = '\0';
+ return;
+ }
- return buffer;
+ strncpy(newservername, dialog.serverName->value(), VNCSERVERNAMELEN);
+ newservername[VNCSERVERNAMELEN - 1] = '\0';
}
void ServerDialog::handleOptions(Fl_Widget *widget, void *data)