correct failsafe size on PaddedString transform fail

This commit is contained in:
wish
2022-08-04 22:55:32 +10:00
parent 556198af72
commit 816ff0eac5

View File

@@ -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
}