Fixed cppcheck errors in ftplib.cpp. This solves #3.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit d08b667172)
r14.0.x
Michele Calgaro 6 years ago
parent 8acdd39bef
commit 8e07c22986
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -756,6 +756,7 @@ int ftplib::FtpOpenPort(netbuf *nControl, netbuf **nData, int mode, int dir, cha
{
FtpClose(*nData);
*nData = NULL;
free(ctrl);
return -1;
}
@ -851,9 +852,10 @@ int ftplib::FtpOpenPasv(netbuf *nControl, netbuf **nData, int mode, int dir, cha
}
if (nControl->dir != FTPLIB_CONTROL) return -1;
sprintf(cmd,"%s\r\n",cmd);
if (nControl->tlsctrl) ret = SSL_write(nControl->ssl,cmd,strlen(cmd));
else ret = write(nControl->handle,cmd,strlen(cmd));
char buf[256];
sprintf(buf,"%s\r\n",cmd);
if (nControl->tlsctrl) ret = SSL_write(nControl->ssl,buf,strlen(buf));
else ret = write(nControl->handle,buf,strlen(buf));
if (ret <= 0)
{
perror("write");

Loading…
Cancel
Save