Length checking
This commit is contained in:
parent
65722aeeca
commit
a98e35d7a0
@ -90,7 +90,7 @@ func IsHex(str string) bool {
|
||||
}
|
||||
|
||||
func StringToByteFunc(str string, cb func(str string) []byte) (ret []byte) {
|
||||
if str[0:2] == "0x" {
|
||||
if len(str) > 1 && str[0:2] == "0x" {
|
||||
ret = FromHex(str[2:])
|
||||
} else {
|
||||
ret = cb(str)
|
||||
|
Loading…
Reference in New Issue
Block a user