aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-18 17:55:05 +0800
committerobscuren <geffobscura@gmail.com>2014-06-18 17:55:05 +0800
commit2fbcfd88249de8f55b7f06619d9003fadcc8e1e3 (patch)
tree7ccc28a91fe84eddfa3bfb1af631f9357858b152 /ethutil
parentdc9c9369e0b44873dedfdf37195268f0e524872d (diff)
downloadgo-tangerine-2fbcfd88249de8f55b7f06619d9003fadcc8e1e3.tar
go-tangerine-2fbcfd88249de8f55b7f06619d9003fadcc8e1e3.tar.gz
go-tangerine-2fbcfd88249de8f55b7f06619d9003fadcc8e1e3.tar.bz2
go-tangerine-2fbcfd88249de8f55b7f06619d9003fadcc8e1e3.tar.lz
go-tangerine-2fbcfd88249de8f55b7f06619d9003fadcc8e1e3.tar.xz
go-tangerine-2fbcfd88249de8f55b7f06619d9003fadcc8e1e3.tar.zst
go-tangerine-2fbcfd88249de8f55b7f06619d9003fadcc8e1e3.zip
Proper checks for multiple data items. Fixes #80
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/bytes.go3
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)