summaryrefslogtreecommitdiff
path: root/apps/netutils/ftpc/ftpc_pwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/netutils/ftpc/ftpc_pwd.c')
-rw-r--r--apps/netutils/ftpc/ftpc_pwd.c10
1 files changed, 8 insertions, 2 deletions
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)
{