1
0
mirror of https://github.com/golang/go synced 2024-11-22 21:20:03 -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:
Russ Cox 2013-07-12 14:23:36 -04:00
parent 0ce56e60b8
commit 8124a02cb2
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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