summaryrefslogtreecommitdiff
path: root/libgo/go/fmt/format.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/fmt/format.go')
-rw-r--r--libgo/go/fmt/format.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgo/go/fmt/format.go b/libgo/go/fmt/format.go
index 2e2b0716edc..a54f12ee9f9 100644
--- a/libgo/go/fmt/format.go
+++ b/libgo/go/fmt/format.go
@@ -372,7 +372,10 @@ func (f *fmt) formatFloat(v float64, verb byte, prec, n int) {
default:
// There's no sign, but we might need one.
if f.plus {
- slice[0] = '+'
+ f.buf.WriteByte('+')
+ f.wid--
+ f.pad(slice[1:])
+ return
} else if f.space {
// space is already there
} else {