mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 11:36:37 +00:00
Length checking
This commit is contained in:
parent
65722aeeca
commit
a98e35d7a0
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ func IsHex(str string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func StringToByteFunc(str string, cb func(str string) []byte) (ret []byte) {
|
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:])
|
ret = FromHex(str[2:])
|
||||||
} else {
|
} else {
|
||||||
ret = cb(str)
|
ret = cb(str)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue