aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2020-12-07 12:28:07 +0100
committerPierre Ossman <ossman@cendio.se>2020-12-07 12:28:07 +0100
commitb2b265a18305f5675f803b6c83f625181bf8e27c (patch)
tree4d4812b67488574f723c13edf34d07ccac26c2e2 /vncviewer
parent25d3167e81f65b46b61afa1404703c616ea43e4d (diff)
downloadtigervnc-b2b265a18305f5675f803b6c83f625181bf8e27c.tar.gz
tigervnc-b2b265a18305f5675f803b6c83f625181bf8e27c.zip
Remove bogus strncpy() calls
We don't know the size of the output buffer here and giving the input string size is just confusing and upsets the compiler in some cases.
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/vncviewer.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index b3371c4c..68a37477 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -454,11 +454,9 @@ interpretViaParam(char *remoteHost, int *remotePort, int localPort)
}
if (*vncServerName != '\0')
- strncpy(remoteHost, vncServerName, VNCSERVERNAMELEN);
+ strcpy(remoteHost, vncServerName);
else
- strncpy(remoteHost, "localhost", VNCSERVERNAMELEN);
-
- remoteHost[VNCSERVERNAMELEN - 1] = '\0';
+ strcpy(remoteHost, "localhost");
snprintf(vncServerName, VNCSERVERNAMELEN, "localhost::%d", localPort);
vncServerName[VNCSERVERNAMELEN - 1] = '\0';