summaryrefslogtreecommitdiff
path: root/src/pkg/strconv/atoi.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/strconv/atoi.go')
-rw-r--r--src/pkg/strconv/atoi.go6
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