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:
patacongo
2011-06-05 14:08:26 +00:00
parent a414a831a3
commit 33a74e2ffa
8 changed files with 997 additions and 821 deletions

View File

@@ -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;
}