Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3860)

Issue 12498043: code review 12498043: fmt: fix up zero padding (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by r
Modified:
10 years, 8 months ago
Reviewers:
rsc
CC:
golang-dev, rsc
Visibility:
Public.

Description

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 issue 6044.

Patch Set 1 #

Total comments: 1

Patch Set 2 : diff -r 626c01d29570 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -2 lines) Patch
M src/pkg/fmt/fmt_test.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
M src/pkg/fmt/format.go View 4 chunks +15 lines, -2 lines 0 comments Download

Messages

Total messages: 3
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
10 years, 8 months ago (2013-08-06 01:17:49 UTC) #1
rsc
LGTM https://codereview.appspot.com/12498043/diff/1/src/pkg/fmt/fmt_test.go File src/pkg/fmt/fmt_test.go (right): https://codereview.appspot.com/12498043/diff/1/src/pkg/fmt/fmt_test.go#newcode502 src/pkg/fmt/fmt_test.go:502: // Zero padding floats put the minus sign ...
10 years, 8 months ago (2013-08-06 16:11:05 UTC) #2
r
10 years, 8 months ago (2013-08-06 22:38:55 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=25cf345dde57 ***

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 issue 6044.

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/12498043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b