lxdrgen-go: fix compatibility with 32-bit targets
All checks were successful
Alpine 3.20 Success

This commit is contained in:
Přemysl Eric Janouch 2024-11-09 17:06:46 +01:00
parent aacf1b1d47
commit 492815c8fc
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -145,7 +145,7 @@ function codegen_begin( funcname) {
print "// " funcname " tries to serialize a string value,"
print "// appending it to the end of a byte stream."
print "func " funcname "(data []byte, s string) ([]byte, bool) {"
print "\tif len(s) > math.MaxUint32 {"
print "\tif int64(len(s)) > math.MaxUint32 {"
print "\t\treturn nil, false"
print "\t}"
print "\tdata = binary.BigEndian.AppendUint32(data, uint32(len(s)))"