From 816ff0eac582d399da5930056cd6bbde03e5743e Mon Sep 17 00:00:00 2001 From: wish Date: Thu, 4 Aug 2022 22:55:32 +1000 Subject: [PATCH] correct failsafe size on PaddedString transform fail --- common/stringsupport/string_convert.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/stringsupport/string_convert.go b/common/stringsupport/string_convert.go index 75951b4ca..84574375b 100644 --- a/common/stringsupport/string_convert.go +++ b/common/stringsupport/string_convert.go @@ -106,7 +106,7 @@ func PaddedString(x string, size uint, t bool) []byte { e := japanese.ShiftJIS.NewEncoder() xt, _, err := transform.String(e, x) if err != nil { - return make([]byte, 0) + return make([]byte, size) } x = xt }