summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-10-16 14:38:48 -0400
committersiddharth <s@ricketyspace.net>2021-10-16 14:38:48 -0400
commitcc9a9dc2cdcca756b4cb8e926b9627912536c3a8 (patch)
tree38fa7a32433ce3db4aef970f2dcf2f859581ac3f /lib
parent194f13eb22e2ec821f42592b98017a1d7df36a33 (diff)
lib: fix HexStrToBytes
Diffstat (limited to 'lib')
-rw-r--r--lib/hex.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hex.go b/lib/hex.go
index ff5ee27..8298b9d 100644
--- a/lib/hex.go
+++ b/lib/hex.go
@@ -48,7 +48,7 @@ func HexStrToAsciiStr(h string) string {
func HexStrToBytes(h string) []byte {
lh := len(h)
- if lh < 1 {
+ if lh < 1 || lh%2 != 0 {
return []byte{}
}
if lh == 1 {