diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
commit | 28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch) | |
tree | 32944e18b23f7fe4a0818a694aa2a6dfb1835463 /src/pkg/strconv/atoi.go | |
parent | e836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff) | |
download | golang-upstream/59.tar.gz |
Imported Upstream version 59upstream/59
Diffstat (limited to 'src/pkg/strconv/atoi.go')
-rw-r--r-- | src/pkg/strconv/atoi.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pkg/strconv/atoi.go b/src/pkg/strconv/atoi.go index f7b845672..e1154782b 100644 --- a/src/pkg/strconv/atoi.go +++ b/src/pkg/strconv/atoi.go @@ -42,6 +42,8 @@ func cutoff64(base int) uint64 { // digits, err.Error = os.EINVAL; if the value corresponding // to s cannot be represented by a uint64, err.Error = os.ERANGE. func Btoui64(s string, b int) (n uint64, err os.Error) { + var cutoff uint64 + s0 := s switch { case len(s) < 1: @@ -68,12 +70,12 @@ func Btoui64(s string, b int) (n uint64, err os.Error) { } default: - err = os.ErrorString("invalid base " + Itoa(b)) + err = os.NewError("invalid base " + Itoa(b)) goto Error } n = 0 - cutoff := cutoff64(b) + cutoff = cutoff64(b) for i := 0; i < len(s); i++ { var v byte |