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 Luke Dashjr
parent 1175d8f6a1
commit ef2f3ddaf7
3 changed files with 7 additions and 7 deletions

View File

@@ -147,7 +147,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";
}