From: David du Colombier <0intro@gmail.com> Date: Tue, 2 Sep 2014 22:56:50 +0000 (+0200) Subject: runtime: don't allocate a new string in snprintf X-Git-Tag: go1.4beta1~570 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d8cbbe68024256ef4ead0a9d4d9d874c28f41a31;p=gostls13.git 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 --- 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 }