runtime: terminate exit status buffer on Plan 9
The status buffer built by the exit function
was not nil-terminated.
Fixes #10789.
Change-Id: I2d34ac50a19d138176c4b47393497ba7070d5b61
Reviewed-on: https://go-review.googlesource.com/9953
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/src/runtime/os1_plan9.go b/src/runtime/os1_plan9.go
index c026218..1aae96a 100644
--- a/src/runtime/os1_plan9.go
+++ b/src/runtime/os1_plan9.go
@@ -177,7 +177,7 @@
} else {
// build error string
var tmp [32]byte
- status = []byte(gostringnocopy(&itoa(tmp[:len(tmp)-1], uint64(e))[0]))
+ status = append(itoa(tmp[:len(tmp)-1], uint64(e)), 0)
}
goexitsall(&status[0])
exits(&status[0])