Fix more FTP bugs

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3664 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-06-03 16:15:49 +00:00
parent 72b70475b5
commit a94c011b4e
3 changed files with 11 additions and 4 deletions

View File

@ -74,7 +74,8 @@
* Name: ftpc_filetime
*
* Descripton:
* Return the timestamp on the remote file.
* Return the timestamp on the remote file. Returned time is UTC
* (Universal Coordinated Time).
*
****************************************************************************/

View File

@ -113,9 +113,15 @@ FAR char *ftpc_pwd(SESSION handle)
return NULL;
}
/* Allocate memory for the path name */
/* Allocate memory for the path name:
*
* Reply: 257 "/home/gnutt"
* ^start ^end
*
* len = end - start + 1 = 11 (+ NUL terminator)
*/
len = end - start;
len = end - start + 1;
pwd = (char *)malloc(len + 1);
if (!pwd)
{

View File

@ -182,7 +182,7 @@ void ftpc_stripslash(FAR char *str)
if (len > 1)
{
ptr = str + len - 1;
if (*ptr == '/');
if (*ptr == '/')
{
*ptr = '\0';
}