Skip to content

Commit

Permalink
icmp, webdav/internal/xml: avoid string(int)
Browse files Browse the repository at this point in the history
Updates golang/go#32479

Change-Id: Ife0c3a2f10afb676af5f2110a9681216122c8808
Reviewed-on: https://go-review.googlesource.com/c/net/+/233900
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
bradfitz committed May 13, 2020
1 parent 7e3656a commit a91f071
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion icmp/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func parseInterfaceIdent(b []byte) (Extension, error) {
}
switch ifi.Type {
case typeInterfaceByName:
ifi.Name = strings.Trim(string(b[4:]), string(0))
ifi.Name = strings.Trim(string(b[4:]), "\x00")
case typeInterfaceByIndex:
if len(b[4:]) < 4 {
return nil, errInvalidExtension
Expand Down
4 changes: 2 additions & 2 deletions webdav/internal/xml/xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ func (d *Decoder) ungetc(b byte) {
d.offset--
}

var entity = map[string]int{
var entity = map[string]rune{
"lt": '<',
"gt": '>',
"amp": '&',
Expand Down Expand Up @@ -1040,7 +1040,7 @@ Input:
d.buf.WriteByte(';')
n, err := strconv.ParseUint(s, base, 64)
if err == nil && n <= unicode.MaxRune {
text = string(n)
text = string(rune(n))
haveText = true
}
}
Expand Down

0 comments on commit a91f071

Please sign in to comment.