Removed the use of the lastIndexOf function which was replaced by the builtin strrchr function

This commit is contained in:
Th3maz1ng 2022-04-17 21:54:41 +02:00
parent f981c06fc3
commit 285c9ef20b

View File

@ -473,7 +473,7 @@ class FTPServer : public TCPServer<T>
char *dirCopy = (char *)malloc((sizeof(char) * strlen(client->_currentDirectory)) + 1); char *dirCopy = (char *)malloc((sizeof(char) * strlen(client->_currentDirectory)) + 1);
strcpy(dirCopy, client->_currentDirectory); strcpy(dirCopy, client->_currentDirectory);
char *p = lastIndexOf(dirCopy, '/'); char *p = strrchr(dirCopy, '/');
if (dirCopy == p) if (dirCopy == p)
{ {
*(p + 1) = '\0'; *(p + 1) = '\0';