]> Cypherpunks repositories - gostls13.git/commit
fmt: fix up zero padding
authorRob Pike <r@golang.org>
Tue, 6 Aug 2013 22:38:46 +0000 (08:38 +1000)
committerRob Pike <r@golang.org>
Tue, 6 Aug 2013 22:38:46 +0000 (08:38 +1000)
commitf59064de80eed5e7a84d20f1a889859cfa8259f7
tree9f551e0d04bfd2922fe962b9110e2d7f8d1a10a8
parent1104a2afb188a97a153727f7a67c243038b49749
fmt: fix up zero padding
If the padding is huge, we crashed by blowing the buffer. That's easy: make sure
we have a big enough buffer by allocating in problematic cases.
Zero padding floats was just wrong in general: the space would appear in the
middle.

Fixes #6044.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12498043
src/pkg/fmt/fmt_test.go
src/pkg/fmt/format.go