• Martin Möhrmann's avatar
    fmt: reuse buffer and add range checks for %c and %q · 42cd69f5
    Martin Möhrmann authored
    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: 's avatarRob Pike <r@golang.org>
    42cd69f5
Name
Last commit
Last update
..
doc.go Loading commit data...
export_test.go Loading commit data...
fmt_test.go Loading commit data...
format.go Loading commit data...
print.go Loading commit data...
scan.go Loading commit data...
scan_test.go Loading commit data...
stringer_test.go Loading commit data...