From 8124a02cb23c0ac988f6e6be4e3e4104baf987c9 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 12 Jul 2013 14:23:36 -0400 Subject: [PATCH] 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 --- src/cmd/5a/lex.c | 2 +- src/cmd/6a/lex.c | 2 +- src/cmd/8a/lex.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/5a/lex.c b/src/cmd/5a/lex.c index 3ce1bfe9524..d997754fd3a 100644 --- a/src/cmd/5a/lex.c +++ b/src/cmd/5a/lex.c @@ -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; diff --git a/src/cmd/6a/lex.c b/src/cmd/6a/lex.c index 89143e78941..290785c551d 100644 --- a/src/cmd/6a/lex.c +++ b/src/cmd/6a/lex.c @@ -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; diff --git a/src/cmd/8a/lex.c b/src/cmd/8a/lex.c index a7840f6258a..2e690851293 100644 --- a/src/cmd/8a/lex.c +++ b/src/cmd/8a/lex.c @@ -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;