mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-28 00:27:26 +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) {
|
||||
if str[0:2] == "0x" {
|
||||
if len(str) > 1 && str[0:2] == "0x" {
|
||||
ret = FromHex(str[2:])
|
||||
} else {
|
||||
ret = cb(str)
|
||||
|
|
|
|||
Loading…
Reference in a new issue