Browse Source

- returning empty string instead of NULL

cl-refactor
yann300 10 years ago
parent
commit
5f4627043d
  1. 8
      libdevcore/CommonJS.cpp

8
libdevcore/CommonJS.cpp

@ -87,22 +87,22 @@ std::string fromRaw(h256 _n, unsigned* _inc)
std::string s((char const*)_n.data(), 32);
auto l = s.find_first_of('\0');
if (!l)
return NULL;
return "";
if (l != std::string::npos)
{
auto p = s.find_first_not_of('\0', l);
if (!(p == std::string::npos || (_inc && p == 31)))
return NULL;
return "";
if (_inc)
*_inc = (byte)s[31];
s.resize(l);
}
for (auto i: s)
if (i < 32)
return NULL;
return "";
return s;
}
return NULL;
return "";
}
Address fromString(std::string _sn)

Loading…
Cancel
Save