From 1d7cdf2366eb61cb86d89ee1c3312dbf7f2b0a82 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 1 Mar 2014 00:39:36 +0000 Subject: [PATCH] Fix for 32-byte names. --- alethzero/MainWin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 1b8db3bcf..475c6cffd 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -148,7 +148,8 @@ QString Main::pretty(eth::Address _a) const if (h256 n = state().contractMemory(m_nameReg, (h256)(u256)(u160)_a)) { std::string s((char const*)n.data(), 32); - s.resize(s.find_first_of('\0')); + if (s.find_first_of('\0') != string::npos) + s.resize(s.find_first_of('\0')); return QString::fromStdString(s); } return QString();