aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2014-09-03 00:56:50 +0200
committerDavid du Colombier <0intro@gmail.com>2014-09-03 00:56:50 +0200
commitd8cbbe68024256ef4ead0a9d4d9d874c28f41a31 (patch)
tree914a447ad4291610fbbc67a23d8c57db3eaf1300 /src/pkg/runtime
parentb3f224b2801059bf6b2d1b4001ffd8d34c91d19e (diff)
downloadgo-d8cbbe68024256ef4ead0a9d4d9d874c28f41a31.tar.xz
runtime: don't allocate a new string in snprintf
This fixes the Plan 9 build. Fix issue 8621. LGTM=iant R=rsc, mattn.jp, iant CC=golang-codereviews https://golang.org/cl/135280043
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/print1.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/print1.go b/src/pkg/runtime/print1.go
index 28faa7cbbb..93f83ed26f 100644
--- a/src/pkg/runtime/print1.go
+++ b/src/pkg/runtime/print1.go
@@ -54,7 +54,7 @@ func snprintf(dst *byte, n int32, s *byte) {
gp := getg()
gp.writebuf = buf[0:0 : n-1] // leave room for NUL, this is called from C
- vprintf(gostring(s), add(unsafe.Pointer(&s), unsafe.Sizeof(s)))
+ vprintf(gostringnocopy(s), add(unsafe.Pointer(&s), unsafe.Sizeof(s)))
buf[len(gp.writebuf)] = '\x00'
gp.writebuf = nil
}