aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/string.go')
-rw-r--r--src/runtime/string.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/string.go b/src/runtime/string.go
index f8ccd41b1d..dd04bda04b 100644
--- a/src/runtime/string.go
+++ b/src/runtime/string.go
@@ -139,7 +139,7 @@ func slicebytetostringtmp(b []byte) string {
func stringtoslicebyte(buf *tmpBuf, s string) []byte {
var b []byte
if buf != nil && len(s) <= len(buf) {
- b = buf[:len(s)]
+ b = buf[:len(s):len(s)]
} else {
b = rawbyteslice(len(s))
}
@@ -171,7 +171,7 @@ func stringtoslicerune(buf *[tmpStringBufSize]rune, s string) []rune {
}
var a []rune
if buf != nil && n <= len(buf) {
- a = buf[:n]
+ a = buf[:n:n]
} else {
a = rawruneslice(n)
}