diff options
author | Maran <maran.hidskes@gmail.com> | 2014-06-18 19:19:03 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-06-18 19:19:03 +0800 |
commit | fba6de834ec262313aba7c4f45b05fe6ff074e46 (patch) | |
tree | cf4facc4b61c7c70627e0dad537cdf0a0f79f5e8 /ethutil/bytes.go | |
parent | 22e16f15a69f53934a61978eb18fdf0244a74a99 (diff) | |
parent | 2fbcfd88249de8f55b7f06619d9003fadcc8e1e3 (diff) | |
download | dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.gz dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.bz2 dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.lz dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.xz dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.zst dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.zip |
Merge branch 'develop' of github.com:ethereum/eth-go into develop
Diffstat (limited to 'ethutil/bytes.go')
-rw-r--r-- | ethutil/bytes.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go index bd0df68ec..5e3ee4a6f 100644 --- a/ethutil/bytes.go +++ b/ethutil/bytes.go @@ -5,6 +5,7 @@ import ( "encoding/binary" "fmt" "math/big" + "strings" ) // Number to bytes @@ -91,7 +92,7 @@ func IsHex(str string) bool { } func StringToByteFunc(str string, cb func(str string) []byte) (ret []byte) { - if len(str) > 1 && str[0:2] == "0x" { + if len(str) > 1 && str[0:2] == "0x" && !strings.Contains(str, "\n") { ret = FromHex(str[2:]) } else { ret = cb(str) |