Fixes for variable shadowing (1/28)

This commit is contained in:
John Wiegley 2012-02-17 14:25:59 -06:00
parent d669cd736d
commit 76f979901e

View file

@ -49,28 +49,28 @@ account_t::~account_t()
} }
} }
account_t * account_t::find_account(const string& name, account_t * account_t::find_account(const string& acct_name,
const bool auto_create) const bool auto_create)
{ {
accounts_map::const_iterator i = accounts.find(name); accounts_map::const_iterator i = accounts.find(acct_name);
if (i != accounts.end()) if (i != accounts.end())
return (*i).second; return (*i).second;
char buf[8192]; char buf[8192];
string::size_type sep = name.find(':'); string::size_type sep = acct_name.find(':');
assert(sep < 256|| sep == string::npos); assert(sep < 256|| sep == string::npos);
const char * first, * rest; const char * first, * rest;
if (sep == string::npos) { if (sep == string::npos) {
first = name.c_str(); first = acct_name.c_str();
rest = NULL; rest = NULL;
} else { } else {
std::strncpy(buf, name.c_str(), sep); std::strncpy(buf, acct_name.c_str(), sep);
buf[sep] = '\0'; buf[sep] = '\0';
first = buf; first = buf;
rest = name.c_str() + sep + 1; rest = acct_name.c_str() + sep + 1;
} }
account_t * account; account_t * account;