Procházet zdrojové kódy

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.
tags/v1.11.90
Pierre Ossman před 3 roky
rodič
revize
b2b265a183
1 změnil soubory, kde provedl 2 přidání a 4 odebrání
  1. 2
    4
      vncviewer/vncviewer.cxx

+ 2
- 4
vncviewer/vncviewer.cxx Zobrazit soubor

@@ -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';

Načítá se…
Zrušit
Uložit