diff options
author | Pierre Ossman <ossman@cendio.se> | 2020-12-07 12:28:07 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-12-07 12:28:07 +0100 |
commit | b2b265a18305f5675f803b6c83f625181bf8e27c (patch) | |
tree | 4d4812b67488574f723c13edf34d07ccac26c2e2 /vncviewer | |
parent | 25d3167e81f65b46b61afa1404703c616ea43e4d (diff) | |
download | tigervnc-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.cxx | 6 |
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'; |