diff options
Diffstat (limited to 'src/encoding/xml/xml.go')
| -rw-r--r-- | src/encoding/xml/xml.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/encoding/xml/xml.go b/src/encoding/xml/xml.go index 8c15b98c3a..5690b20256 100644 --- a/src/encoding/xml/xml.go +++ b/src/encoding/xml/xml.go @@ -1119,12 +1119,12 @@ func (d *Decoder) name() (s string, ok bool) { } // Now we check the characters. - s = d.buf.String() - if !isName([]byte(s)) { - d.err = d.syntaxError("invalid XML name: " + s) + b := d.buf.Bytes() + if !isName(b) { + d.err = d.syntaxError("invalid XML name: " + string(b)) return "", false } - return s, true + return string(b), true } // Read a name and append its bytes to d.buf. |
