The string class returns string::npos, when find() fails.

Noticed when sign-comparison warnings were enabled.
This commit is contained in:
Jeff Garzik
2012-04-15 16:47:24 -04:00
committed by Jeff Garzik
parent 5a701eb7ea
commit ab9dc75a18
3 changed files with 7 additions and 7 deletions

View File

@@ -201,7 +201,7 @@ Value help(const Array& params, bool fHelp)
// Help text is returned in an exception
string strHelp = string(e.what());
if (strCommand == "")
if (strHelp.find('\n') != -1)
if (strHelp.find('\n') != string::npos)
strHelp = strHelp.substr(0, strHelp.find('\n'));
strRet += strHelp + "\n";
}