diff options
author | Peter Powell <petpow@saberuk.com> | 2013-05-06 11:49:50 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-05-15 03:32:56 +0100 |
commit | accccc212cd4f08a3c5532b1ae7a17e76bac8718 (patch) | |
tree | 18f4370778cc79d2f21a4308dafbb29a77cfa213 /src/server.cpp | |
parent | 23e8bba13c55d33ce89d505780da36c9589e300a (diff) |
Replace some C-isms with C++-isms.
* 'const char*' to 'const std::string&'.
* snprintf to std::string concatenation.
* Replace duplicated OneOfMatches with InspIRCd::MatchMask.
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/server.cpp b/src/server.cpp index 6790b45e7..c2068d75b 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -66,17 +66,11 @@ void RehashHandler::Call(const std::string &reason) } } -std::string InspIRCd::GetVersionString(bool operstring) +std::string InspIRCd::GetVersionString(bool getFullVersion) { - char versiondata[MAXBUF]; - if (operstring) - { - std::string sename = SE->GetName(); - snprintf(versiondata,MAXBUF,"%s %s :%s [%s,%s,%s]",VERSION, Config->ServerName.c_str(), SYSTEM,REVISION, sename.c_str(), Config->sid.c_str()); - } - else - snprintf(versiondata,MAXBUF,"%s %s :%s",BRANCH,Config->ServerName.c_str(),Config->CustomVersion.c_str()); - return versiondata; + if (getFullVersion) + return VERSION " " + Config->ServerName + " :" SYSTEM " [" REVISION "," + SE->GetName() + "," + Config->sid + "]"; + return BRANCH " " + Config->ServerName + " :" + Config->CustomVersion; } const char InspIRCd::LogHeader[] = |