From b33a5294eaf06a3e952efe1ce4ef810af37d1062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 29 Nov 2017 02:21:41 +0200 Subject: common: fix hex utils to handle 1 byte address conversions --- common/bytes.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'common/bytes.go') diff --git a/common/bytes.go b/common/bytes.go index 66577bbfd..bb40ac1d7 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -35,12 +35,11 @@ func FromHex(s string) []byte { if s[0:2] == "0x" || s[0:2] == "0X" { s = s[2:] } - if len(s)%2 == 1 { - s = "0" + s - } - return Hex2Bytes(s) } - return nil + if len(s)%2 == 1 { + s = "0" + s + } + return Hex2Bytes(s) } // Copy bytes -- cgit v1.2.3