diff options
| author | Martin Möhrmann <martisch@uos.de> | 2016-03-08 20:13:58 +0100 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2016-03-16 05:13:29 +0000 |
| commit | 42cd69f5d1a222a2e794d19e0b287dde2ee9a112 (patch) | |
| tree | 891802f25a23b97d2fcc13f6128434ede89c7b78 /src/runtime/debug | |
| parent | b8ddcc0a03415786bb6278849530c88bfa5b97e6 (diff) | |
| download | go-42cd69f5d1a222a2e794d19e0b287dde2ee9a112.tar.xz | |
fmt: reuse buffer and add range checks for %c and %q
Use The fmt internal buffer for character formatting instead of
the pp Printer rune decoding buffer.
Uses an uint64 instead of int64 argument to fmt_c and fmt_qc for easier
range checks since no valid runes are represented by negative numbers or
are above 0x10ffff.
Add range checks to fmt_c and fmt_qc to guarantee that a RuneError
character is returned by the functions for any invalid code point
in range uint64. For invalid code points in range utf8.MaxRune
the used utf8 and strconv functions already return a RuneError.
Change-Id: I9772f804dfcd79c3826fa7f6c5ebfbf4b5304a51
Reviewed-on: https://go-review.googlesource.com/20373
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/runtime/debug')
0 files changed, 0 insertions, 0 deletions
