mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 11:23:07 +08:00
More FTP bug fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3669 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -331,20 +331,28 @@ int tftpc_parseargs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* There should be exactly on parameter left on the command-line */
|
||||
/* There should be exactly one parameter left on the command-line */
|
||||
|
||||
if (optind == argc-1)
|
||||
{
|
||||
args->srcpath = argv[optind];
|
||||
}
|
||||
|
||||
/* optind == argc means that there is nothing left on the command-line */
|
||||
|
||||
else if (optind >= argc)
|
||||
{
|
||||
fmt = g_fmttoomanyargs;
|
||||
fmt = g_fmtargrequired;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* optind < argc-1 means that there are too many arguments on the
|
||||
* command-line
|
||||
*/
|
||||
|
||||
else
|
||||
{
|
||||
fmt = g_fmtargrequired;
|
||||
fmt = g_fmttoomanyargs;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user