summaryrefslogtreecommitdiff
path: root/src/pkg/strconv/itoa.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/strconv/itoa.go')
-rw-r--r--src/pkg/strconv/itoa.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pkg/strconv/itoa.go b/src/pkg/strconv/itoa.go
index a63356053..a0a749664 100644
--- a/src/pkg/strconv/itoa.go
+++ b/src/pkg/strconv/itoa.go
@@ -6,12 +6,15 @@ package strconv
// Uitob64 returns the string representation of i in the given base.
func Uitob64(u uint64, base uint) string {
+ if base < 2 || 36 < base {
+ panic("invalid base " + Uitoa(base))
+ }
if u == 0 {
return "0"
}
// Assemble decimal in reverse order.
- var buf [32]byte
+ var buf [64]byte
j := len(buf)
b := uint64(base)
for u > 0 {