aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/bytes.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-20 06:47:52 +0800
committerobscuren <geffobscura@gmail.com>2014-06-20 06:47:52 +0800
commit3f1f8438ed8bf7b63ea5172090a5c7025cb093f0 (patch)
tree6ef2ddd9ff6bff930e48368e7ccb442de9ca7f9e /ethutil/bytes.go
parent5a0e75173626704c3d58be582dff318218569ef3 (diff)
parent7ad073fb30e92689942d938939223bd01cb5fe38 (diff)
downloadgo-tangerine-3f1f8438ed8bf7b63ea5172090a5c7025cb093f0.tar
go-tangerine-3f1f8438ed8bf7b63ea5172090a5c7025cb093f0.tar.gz
go-tangerine-3f1f8438ed8bf7b63ea5172090a5c7025cb093f0.tar.bz2
go-tangerine-3f1f8438ed8bf7b63ea5172090a5c7025cb093f0.tar.lz
go-tangerine-3f1f8438ed8bf7b63ea5172090a5c7025cb093f0.tar.xz
go-tangerine-3f1f8438ed8bf7b63ea5172090a5c7025cb093f0.tar.zst
go-tangerine-3f1f8438ed8bf7b63ea5172090a5c7025cb093f0.zip
Merge branch 'release/0.5.14'
Diffstat (limited to 'ethutil/bytes.go')
-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)