Length checking

pull/150/head
obscuren 11 years ago
parent 65722aeeca
commit a98e35d7a0
  1. 2
      ethutil/bytes.go

@ -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…
Cancel
Save