summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-10 23:49:24 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-10 23:49:24 +0000
commite2f6064f10df88c129a155e403c33344f1eb295c (patch)
tree61290b31ef3050b6c9894656a0fe168a1dc8555f /src
parent87065c514afab4b4c904f9eace6632459d8e748a (diff)
Fixed compile errors in os_szline.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1998 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/core/os_szline.c17
-rw-r--r--src/operserv.c2
2 files changed, 10 insertions, 9 deletions
diff --git a/src/core/os_szline.c b/src/core/os_szline.c
index 8c9cc241d..a3224ba7f 100644
--- a/src/core/os_szline.c
+++ b/src/core/os_szline.c
@@ -26,7 +26,8 @@ class CommandOSSZLine : public Command
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
{
- int deleted = 0, last_param = 2;
+ int deleted = 0;
+ unsigned last_param = 2;
const char *expiry, *mask;
char reason[BUFSIZE];
time_t expires;
@@ -61,7 +62,7 @@ class CommandOSSZLine : public Command
this->OnSyntaxError(u);
return MOD_CONT;
}
- snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? param[3].c_str() : "");
+ snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? params[3].c_str() : "");
if (mask && *reason)
{
/* We first do some sanity check on the proposed mask. */
@@ -94,7 +95,7 @@ class CommandOSSZLine : public Command
else
{
int wall_expiry = expires - time(NULL);
- char *s = NULL;
+ const char *s = NULL;
if (wall_expiry >= 86400)
{
@@ -130,7 +131,7 @@ class CommandOSSZLine : public Command
CommandReturn DoDel(User *u, std::vector<std::string> &params)
{
- char *mask;
+ const char *mask;
int res = 0;
mask = params.size() > 1 ? params[1].c_str() : NULL;
@@ -163,7 +164,7 @@ class CommandOSSZLine : public Command
}
else
{
- if ((res = slist_indexof(&szlines, mask)) == -1)
+ if ((res = slist_indexof(&szlines, const_cast<char *>(mask))) == -1)
{
notice_lang(s_OperServ, u, OPER_SZLINE_NOT_FOUND, mask);
return MOD_CONT;
@@ -181,7 +182,7 @@ class CommandOSSZLine : public Command
CommandReturn DoList(User *u, std::vector<std::string> &params)
{
- char *mask;
+ const char *mask;
int res, sent_header = 0;
if (!szlines.count)
@@ -190,7 +191,7 @@ class CommandOSSZLine : public Command
return MOD_CONT;
}
- mask = params.size() > 1 : params[1].c_str() : NULL;
+ mask = params.size() > 1 ? params[1].c_str() : NULL;
if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask)))
{
@@ -222,7 +223,7 @@ class CommandOSSZLine : public Command
CommandReturn DoView(User *u, std::vector<std::string> &params)
{
- char *mask;
+ const char *mask;
int res, sent_header = 0;
if (!szlines.count)
diff --git a/src/operserv.c b/src/operserv.c
index 51ddcfaa1..714a12f11 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -1127,7 +1127,7 @@ static int is_sqline_entry_equal(SList * slist, void *item1, void *item2)
* The success result is the number of SZLINEs that were deleted to successfully add one.
*/
-int add_szline(User * u, char *mask, const char *by, const time_t expires,
+int add_szline(User * u, const char *mask, const char *by, time_t expires,
const char *reason)
{
int deleted = 0, i;