bug correction. Please do not use begin ( ) from returns of a function without const & s

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3612 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-10-05 15:46:08 +00:00
parent 4db463a4dc
commit a90f332a40
2 changed files with 7 additions and 6 deletions

View file

@ -825,11 +825,12 @@ bool p3Config::getHashAttempt(const std::string& loadHash, std::string& hashstr,
PQInterface *stream = NULL; PQInterface *stream = NULL;
std::string tempString, msgConfigFileName; std::string tempString, msgConfigFileName;
std::string::reverse_iterator rit = Filename().rbegin(); std::string filename = Filename() ;
std::string::reverse_iterator rit = filename.rbegin();
// get the msgconfig file name // get the msgconfig file name
for(int i =0; (i <= 7) && (rit != Filename().rend()); i++) for(int i =0; (i <= 7) && (rit != filename.rend()); i++)
{ {
tempString.push_back(*rit); tempString.push_back(*rit);
rit++; rit++;
@ -1306,13 +1307,13 @@ uint32_t pqiConfig::Type()
return type; return type;
} }
std::string pqiConfig::Filename() const std::string& pqiConfig::Filename()
{ {
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/ RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
return filename; return filename;
} }
std::string pqiConfig::Hash() const std::string& pqiConfig::Hash()
{ {
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/ RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
return hash; return hash;

View file

@ -132,13 +132,13 @@ uint32_t Type();
/** /**
* The name of the configuration file * The name of the configuration file
*/ */
std::string Filename(); const std::string& Filename();
/** /**
* The hash computed for this configuration, can use this to compare to externally stored hash * The hash computed for this configuration, can use this to compare to externally stored hash
* for validation checking * for validation checking
*/ */
std::string Hash(); const std::string& Hash();
protected: protected: