diff options
author | Robert Griesemer <gri@golang.org> | 2008-09-19 10:56:35 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2008-09-19 10:56:35 -0700 |
commit | 4b51a4f3a578e7650e38a02c34269e75b18ded5e (patch) | |
tree | 24e8c36eeb565a8756d44cec7e4a4a319157d58f /usr/gri/pretty/platform.go | |
parent | 039f2c593efe8ce18f2a953df61fe71e27b6a375 (diff) | |
download | golang-4b51a4f3a578e7650e38a02c34269e75b18ded5e.tar.gz |
- fix for out-of-bounds error found by rsc
- removed tests that may have wrong Go code from Makefile
R=r
OCL=15532
CL=15532
Diffstat (limited to 'usr/gri/pretty/platform.go')
-rw-r--r-- | usr/gri/pretty/platform.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/gri/pretty/platform.go b/usr/gri/pretty/platform.go index c76d59150..6e96b4ada 100644 --- a/usr/gri/pretty/platform.go +++ b/usr/gri/pretty/platform.go @@ -21,7 +21,7 @@ func GetEnv(key string) string { n := len(key); for i := 0; i < sys.envc(); i++ { v := sys.envv(i); - if v[0 : n] == key { + if n < len(v) && v[0 : n] == key && v[n] == '=' { return v[n + 1 : len(v)]; // +1: trim "=" } } |