diff options
Diffstat (limited to 'libgo/go/bufio/bufio.go')
-rw-r--r-- | libgo/go/bufio/bufio.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libgo/go/bufio/bufio.go b/libgo/go/bufio/bufio.go index 6baf9b9..ec928e7 100644 --- a/libgo/go/bufio/bufio.go +++ b/libgo/go/bufio/bufio.go @@ -670,7 +670,8 @@ func (b *Writer) WriteByte(c byte) error { // WriteRune writes a single Unicode code point, returning // the number of bytes written and any error. func (b *Writer) WriteRune(r rune) (size int, err error) { - if r < utf8.RuneSelf { + // Compare as uint32 to correctly handle negative runes. + if uint32(r) < utf8.RuneSelf { err = b.WriteByte(byte(r)) if err != nil { return 0, err |