mirror of
https://github.com/golang/go
synced 2024-11-22 21:00:04 -07:00
cmd/5a, cmd/6a, cmd/8a: fix flag parsing
go tool 6a -$(unicode fffd) was crashing. Fixes #5878. R=ken2 CC=golang-dev https://golang.org/cl/11208045
This commit is contained in:
parent
0ce56e60b8
commit
8124a02cb2
@ -68,7 +68,7 @@ main(int argc, char *argv[])
|
||||
ARGBEGIN {
|
||||
default:
|
||||
c = ARGC();
|
||||
if(c >= 0 || c < sizeof(debug))
|
||||
if(c >= 0 && c < sizeof(debug))
|
||||
debug[c] = 1;
|
||||
break;
|
||||
|
||||
|
@ -74,7 +74,7 @@ main(int argc, char *argv[])
|
||||
ARGBEGIN {
|
||||
default:
|
||||
c = ARGC();
|
||||
if(c >= 0 || c < sizeof(debug))
|
||||
if(c >= 0 && c < sizeof(debug))
|
||||
debug[c] = 1;
|
||||
break;
|
||||
|
||||
|
@ -74,7 +74,7 @@ main(int argc, char *argv[])
|
||||
ARGBEGIN {
|
||||
default:
|
||||
c = ARGC();
|
||||
if(c >= 0 || c < sizeof(debug))
|
||||
if(c >= 0 && c < sizeof(debug))
|
||||
debug[c] = 1;
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user