diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-03 16:15:49 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-03 16:15:49 +0000 |
commit | 90e92459a9c7a33fb8a005f87ec3f512b760c487 (patch) | |
tree | 6784d646ebc0fa6c5128b6853537b58ce861bfe8 | |
parent | 01429708989552ee1ce78a662e4bdc9145b49c72 (diff) | |
download | nuttx-90e92459a9c7a33fb8a005f87ec3f512b760c487.tar.gz nuttx-90e92459a9c7a33fb8a005f87ec3f512b760c487.tar.bz2 nuttx-90e92459a9c7a33fb8a005f87ec3f512b760c487.zip |
Fix more FTP bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3664 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | apps/netutils/ftpc/ftpc_filetime.c | 3 | ||||
-rw-r--r-- | apps/netutils/ftpc/ftpc_pwd.c | 10 | ||||
-rw-r--r-- | apps/netutils/ftpc/ftpc_utils.c | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/apps/netutils/ftpc/ftpc_filetime.c b/apps/netutils/ftpc/ftpc_filetime.c index a9558f22d..6b3a1d6db 100644 --- a/apps/netutils/ftpc/ftpc_filetime.c +++ b/apps/netutils/ftpc/ftpc_filetime.c @@ -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). * ****************************************************************************/ diff --git a/apps/netutils/ftpc/ftpc_pwd.c b/apps/netutils/ftpc/ftpc_pwd.c index 809002c9b..e8cfaef70 100644 --- a/apps/netutils/ftpc/ftpc_pwd.c +++ b/apps/netutils/ftpc/ftpc_pwd.c @@ -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) { diff --git a/apps/netutils/ftpc/ftpc_utils.c b/apps/netutils/ftpc/ftpc_utils.c index 45994532e..9692cae4f 100644 --- a/apps/netutils/ftpc/ftpc_utils.c +++ b/apps/netutils/ftpc/ftpc_utils.c @@ -182,7 +182,7 @@ void ftpc_stripslash(FAR char *str) if (len > 1) { ptr = str + len - 1; - if (*ptr == '/'); + if (*ptr == '/') { *ptr = '\0'; } |