mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-11-24 20:29:55 +00:00
trivial fix to make sure we have sufficient arguments before
we mess with a possibly non-existant argv[1] -Erik
This commit is contained in:
parent
a0f0f0cf76
commit
b5b5ac3237
@ -118,11 +118,10 @@ int tail_main(int argc, char **argv)
|
||||
const char *fmt;
|
||||
|
||||
/* Allow legacy syntax of an initial numeric option without -n. */
|
||||
if ((argv[1][0] == '+')
|
||||
|| ((argv[1][0] == '-')
|
||||
if (argc >=2 && ((argv[1][0] == '+') || ((argv[1][0] == '-')
|
||||
/* && (isdigit)(argv[1][1]) */
|
||||
&& (((unsigned int)(argv[1][1] - '0')) <= 9))
|
||||
) {
|
||||
&& (((unsigned int)(argv[1][1] - '0')) <= 9))))
|
||||
{
|
||||
optind = 2;
|
||||
optarg = argv[1];
|
||||
goto GET_COUNT;
|
||||
|
Loading…
Reference in New Issue
Block a user