summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-10 23:17:46 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-10 23:17:46 +0000
commit53e79c21557ee8024936977caebda17634dd1b07 (patch)
treee0ba8bee8f10d52fe19d1ad0b38a4b1870b76cd7 /src
parentfe78ca1399da57c34d0e8071645626f6111cf984 (diff)
Fixed compile errors in os_sgline.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1994 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/core/os_sgline.c16
-rw-r--r--src/operserv.c2
2 files changed, 11 insertions, 7 deletions
diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c
index b79e082c7..baa9f0551 100644
--- a/src/core/os_sgline.c
+++ b/src/core/os_sgline.c
@@ -14,6 +14,7 @@
/*************************************************************************/
#include "module.h"
+#include "hashcomp.h"
void myOperServHelp(User *u);
int sgline_view_callback(SList *slist, int number, void *item, va_list args);
@@ -26,8 +27,9 @@ class CommandOSSGLine : public Command
private:
CommandReturn OnAdd(User *u, std::vector<std::string> &params)
{
- int deleted = 0, last_param = 2;
- const char *param;
+ int deleted = 0;
+ unsigned last_param = 2;
+ const char *param, *expiry;
char rest[BUFSIZE];
time_t expires;
@@ -61,7 +63,7 @@ class CommandOSSGLine : public Command
this->OnSyntaxError(u);
return MOD_CONT;
}
- snprintf(rest, sizeof(rest), "%s%s%s", param, params.size() > last_param ? " " : "", params.size() > last_param ? param[last_param].c_str() : "");
+ snprintf(rest, sizeof(rest), "%s%s%s", param, params.size() > last_param ? " " : "", params.size() > last_param ? params[last_param].c_str() : "");
sepstream sep(rest, ':');
std::string mask;
@@ -76,7 +78,7 @@ class CommandOSSGLine : public Command
if (mask[masklen - 1] == ' ')
mask.erase(masklen - 1);
- const char cmask = mask.c_str();
+ const char *cmask = mask.c_str();
/* We first do some sanity check on the proposed mask. */
@@ -101,7 +103,7 @@ class CommandOSSGLine : public Command
else
{
int wall_expiry = expires - time(NULL);
- char *s = NULL;
+ const char *s = NULL;
if (wall_expiry >= 86400)
{
@@ -169,7 +171,7 @@ class CommandOSSGLine : public Command
notice_lang(s_OperServ, u, OPER_SGLINE_DELETED_SEVERAL, res);
}
else {
- if ((res = slist_indexof(&sglines, mask)) == -1)
+ if ((res = slist_indexof(&sglines, const_cast<char *>(mask))) == -1)
{
notice_lang(s_OperServ, u, OPER_SGLINE_NOT_FOUND, mask);
return MOD_CONT;
@@ -272,6 +274,8 @@ class CommandOSSGLine : public Command
{
slist_clear(&sglines, 1);
notice_lang(s_OperServ, u, OPER_SGLINE_CLEAR);
+
+ return MOD_CONT;
}
public:
CommandOSSGLine() : Command("SGLINE", 1, 3)
diff --git a/src/operserv.c b/src/operserv.c
index 1b05aa84e..b17f895bc 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -723,7 +723,7 @@ static int is_akill_entry_equal(SList * slist, void *item1, void *item2)
* The success result is the number of SGLINEs that were deleted to successfully add one.
*/
-int add_sgline(User * u, char *mask, const char *by, const time_t expires,
+int add_sgline(User * u, const char *mask, const char *by, time_t expires,
const char *reason)
{
int deleted = 0, i;