netutils/ftpc: ftpc_getfile: Fixed permission check and resume offset.
@@ -255,6 +255,8 @@ int ftpc_getfile(SESSION handle, FAR const char *rname,
goto errout;
}
+ offset = 0;
+
/* Get information about the local file */
ret = stat(abslpath, &statbuf);
@@ -267,7 +269,6 @@ int ftpc_getfile(SESSION handle, FAR const char *rname,
nwarn("WARNING: '%s' is a directory\n", abslpath);
goto errout_with_abspath;
}
- }
/* Is it write-able? */
@@ -279,17 +280,14 @@ int ftpc_getfile(SESSION handle, FAR const char *rname,
}
#endif
- /* Are we resuming the transfers? Is so then the starting offset is the
- * size of the existing, partial file.
+ /* Are we resuming the transfers? Is so then the starting offset is
+ * the size of the existing, partial file.
*/
if (how == FTPC_GET_RESUME)
{
offset = statbuf.st_size;
}
- else
- {
- offset = 0;
}
/* Setup to receive the file */
