From accccc212cd4f08a3c5532b1ae7a17e76bac8718 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 6 May 2013 11:49:50 +0100 Subject: Replace some C-isms with C++-isms. * 'const char*' to 'const std::string&'. * snprintf to std::string concatenation. * Replace duplicated OneOfMatches with InspIRCd::MatchMask. --- src/configreader.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index dcf4b7162..cd6122b25 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -335,13 +335,13 @@ struct DeprecatedConfig { /** Tag name. */ std::string tag; - + /** Attribute key. */ std::string key; - + /** Attribute value. */ std::string value; - + /** Reason for deprecation. */ std::string reason; }; @@ -595,14 +595,14 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) ServerInstance->BindPorts(pl); if (pl.size()) { - errstr << "Not all your client ports could be bound.\nThe following port(s) failed to bind:\n"; + errstr << "Not all your client ports could be bound." << std::endl + << "The following port(s) failed to bind:" << std::endl; int j = 1; for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++) { - char buf[MAXBUF]; - snprintf(buf, MAXBUF, "%d. Address: %s Reason: %s\n", j, i->first.empty() ? "" : i->first.c_str(), i->second.c_str()); - errstr << buf; + errstr << j << ".\tAddress: " << (i->first.empty() ? "" : i->first.c_str()) << "\tReason: " + << i->second << std::endl; } } } -- cgit v1.3.1-10-gc9f91