From 492815c8fc38ad6e333b2f1c5094a329e3076155 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sat, 9 Nov 2024 17:06:46 +0100 Subject: lxdrgen-go: fix compatibility with 32-bit targets --- tools/lxdrgen-go.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/lxdrgen-go.awk') diff --git a/tools/lxdrgen-go.awk b/tools/lxdrgen-go.awk index ac6cb8b..e5fb35e 100644 --- a/tools/lxdrgen-go.awk +++ b/tools/lxdrgen-go.awk @@ -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)))" -- cgit v1.2.3-70-g09d2