summaryrefslogtreecommitdiff
path: root/apps/netutils/ftpc/ftpc_getfile.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-03 22:53:36 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-03 22:53:36 +0000
commitad9530eeb839266cc6fa940624dce885f5693a2e (patch)
tree4c9555e7ee46c211847759affee04a7737ce6d4f /apps/netutils/ftpc/ftpc_getfile.c
parent92fd8f5221ca528c2def13897c712d558adf1675 (diff)
downloadpx4-nuttx-ad9530eeb839266cc6fa940624dce885f5693a2e.tar.gz
px4-nuttx-ad9530eeb839266cc6fa940624dce885f5693a2e.tar.bz2
px4-nuttx-ad9530eeb839266cc6fa940624dce885f5693a2e.zip
More FTP fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3666 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils/ftpc/ftpc_getfile.c')
-rw-r--r--apps/netutils/ftpc/ftpc_getfile.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/netutils/ftpc/ftpc_getfile.c b/apps/netutils/ftpc/ftpc_getfile.c
index bf9fc69ea..9df827c6e 100644
--- a/apps/netutils/ftpc/ftpc_getfile.c
+++ b/apps/netutils/ftpc/ftpc_getfile.c
@@ -151,7 +151,7 @@ static int ftpc_recvinit(struct ftpc_session_s *session, FAR const char *path,
/* Accept a connection on the data socket */
- ret = ftpc_sockaccept(&session->data, "r", FTPC_IS_PASSIVE(session));
+ ret = ftpc_sockaccept(&session->data, FTPC_IS_PASSIVE(session));
if (ret != OK)
{
ndbg("data connection not accepted\n");
@@ -274,6 +274,19 @@ int ftpc_getfile(SESSION handle, FAR const char *rname, FAR const char *lname,
off_t offset;
int ret;
+ /* Don't call this with a NULL remote file name */
+
+ DEBUGASSERT(rname);
+
+ /* If the local name is not specified, then it is assumed to the same as
+ * the remote file name.
+ */
+
+ if (!lname)
+ {
+ lname = rname;
+ }
+
/* Get the full path to the local file */
abslpath = ftpc_abslpath(session, lname);