Skip to content

Commit c3f1ef7

Browse files
authored
Merge pull request #126 from mattn/fix/blossom-hash-decode
blossom: fix wrong source length in hex decode of download hash
2 parents d0e719f + 99ef7a8 commit c3f1ef7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

blossom.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ var blossomCmd = &cli.Command{
154154
var hash [32]byte
155155
for i, hhash := range c.Args().Slice() {
156156
if len(hhash) != 64 {
157-
log("invalid blob hash '%s': %s\n", hhash, err)
157+
log("invalid blob hash '%s'\n", hhash)
158158
hasError = true
159159
continue
160160
}
161-
if _, err := hex.Decode(hash[:], unsafe.Slice(unsafe.StringData(hhash), 32)); err != nil {
161+
if _, err := hex.Decode(hash[:], unsafe.Slice(unsafe.StringData(hhash), 64)); err != nil {
162162
log("invalid blob hash '%s': %s\n", hhash, err)
163163
hasError = true
164164
continue

0 commit comments

Comments
 (0)