cmd_date:Set optind to zero in the error case.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
This commit is contained in:
yangguangcai 2024-02-18 17:12:19 +08:00 committed by Xiang Xiao
parent 8130d7e211
commit 49941f1d57

View file

@ -434,6 +434,7 @@ int cmd_date(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
return ret;
errout:
optind = 0;
nsh_error(vtbl, errfmt, argv[0]);
return ERROR;
}