mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Get rid of most strtoul() and atoi() calls and use CString's features instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1320 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+5
-5
@@ -245,7 +245,7 @@ public:
|
||||
if (sTok == "*") {
|
||||
SetDisabled(~0, false);
|
||||
} else {
|
||||
SetDisabled(atoi(sTok.c_str()), false);
|
||||
SetDisabled(sTok.ToUInt(), false);
|
||||
}
|
||||
} else if (sCmdName.Equals("DISABLE")) {
|
||||
CString sTok = sCommand.Token(1);
|
||||
@@ -253,10 +253,10 @@ public:
|
||||
if (sTok == "*") {
|
||||
SetDisabled(~0, true);
|
||||
} else {
|
||||
SetDisabled(atoi(sTok.c_str()), true);
|
||||
SetDisabled(sTok.ToUInt(), true);
|
||||
}
|
||||
} else if (sCmdName.Equals("SETSOURCES")) {
|
||||
SetSources(atoi(sCommand.Token(1).c_str()), sCommand.Token(2, true));
|
||||
SetSources(sCommand.Token(1).ToUInt(), sCommand.Token(2, true));
|
||||
} else if (sCmdName.Equals("CLEAR")) {
|
||||
m_lsWatchers.clear();
|
||||
PutModule("All entries cleared.");
|
||||
@@ -264,12 +264,12 @@ public:
|
||||
CString sCount = sCommand.Token(1);
|
||||
|
||||
if (sCount.size()) {
|
||||
m_Buffer.SetLineCount(atoi(sCount.c_str()));
|
||||
m_Buffer.SetLineCount(sCount.ToUInt());
|
||||
}
|
||||
|
||||
PutModule("Buffer count is set to [" + CString(m_Buffer.GetLineCount()) + "]");
|
||||
} else if (sCmdName.Equals("DEL")) {
|
||||
Remove(atoi(sCommand.Token(1).c_str()));
|
||||
Remove(sCommand.Token(1).ToUInt());
|
||||
} else {
|
||||
PutModule("Unknown command: [" + sCmdName + "]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user