good morning!!!!

Skip to content
Snippets Groups Projects
Commit bdaa4351 authored by Valentin Wüstholz's avatar Valentin Wüstholz Committed by Felix Lange
Browse files

cmd/disasm: fix off-by-one error and improve error handling (#3482)

parent 9a51f5c3
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,9 @@ import (
"fmt"
"io/ioutil"
"os"
"encoding/hex"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
)
......@@ -32,7 +33,11 @@ func main() {
fmt.Println(err)
os.Exit(1)
}
code = common.Hex2Bytes(string(code[:len(code)-1]))
code, err = hex.DecodeString(strings.TrimSpace(string(code[:])))
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("%x\n", code)
for pc := uint64(0); pc < uint64(len(code)); pc++ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment