kbin/primitives: differentiate nullable arrays
Apparently some requests fail if the array is nil, even though the BNF
literally does not differentiate between this.
@@ -98,13 +98,17 @@ func AppendVarintBytes(dst []byte, b []byte) []byte {
return append(dst, b...)
}
-func AppendArrayLen(dst []byte, l int, isNil bool) []byte {
+func AppendNullableArrayLen(dst []byte, l int, isNil bool) []byte {
if isNil {
return AppendInt32(dst, -1)
}
return AppendInt32(dst, int32(l))
}
+func AppendArrayLen(dst []byte, l int) []byte {
+ return AppendInt32(dst, int32(l))
+}
+
type Reader struct {
Src []byte
bad bool
