Commit 8124a02c authored by Russ Cox's avatar Russ Cox

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
parent 0ce56e60
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment