mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 16:29:50 +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;
|
const char *fmt;
|
||||||
|
|
||||||
/* Allow legacy syntax of an initial numeric option without -n. */
|
/* Allow legacy syntax of an initial numeric option without -n. */
|
||||||
if ((argv[1][0] == '+')
|
if (argc >=2 && ((argv[1][0] == '+') || ((argv[1][0] == '-')
|
||||||
|| ((argv[1][0] == '-')
|
|
||||||
/* && (isdigit)(argv[1][1]) */
|
/* && (isdigit)(argv[1][1]) */
|
||||||
&& (((unsigned int)(argv[1][1] - '0')) <= 9))
|
&& (((unsigned int)(argv[1][1] - '0')) <= 9))))
|
||||||
) {
|
{
|
||||||
optind = 2;
|
optind = 2;
|
||||||
optarg = argv[1];
|
optarg = argv[1];
|
||||||
goto GET_COUNT;
|
goto GET_COUNT;
|
||||||
|
Loading…
Reference in New Issue
Block a user