Skip to content

Commit

Permalink
Clarify constant type
Browse files Browse the repository at this point in the history
I'm getting this warning when compiling on Rapsberry Pi: "wsjtx.go:312:12: constant 4294967295 overflows int"
  • Loading branch information
xylo04 committed Oct 10, 2020
1 parent 6e4a1a1 commit 44e3668
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wsjtx/wsjtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,13 @@ func (p *parser) parseUint8() uint8 {
}

func (p *parser) parseUtf8() string {
strlen := int(p.parseUint32())
if strlen == 0xffffffff {
strlen := p.parseUint32()
if strlen == uint32(0xffffffff) {
// this is a sentinel value meaning "null" in QDataStream, but Golang can't have nil strings
strlen = 0
}
value := string(p.buffer[p.cursor:(p.cursor + strlen)])
p.cursor += strlen
value := string(p.buffer[p.cursor:(p.cursor + int(strlen))])
p.cursor += int(strlen)
return value
}

Expand Down

0 comments on commit 44e3668

Please sign in to comment.