mirror of
https://github.com/anope/anope.git
synced 2026-07-01 15:26:39 +02:00
Fixed compile errors in os_sgline.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1994 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+1
-1
@@ -781,7 +781,7 @@ E int check_akill(const char *nick, const char *username, const char *host, cons
|
||||
E void expire_akills();
|
||||
E void oper_global(char *nick, const char *fmt, ...);
|
||||
|
||||
E int add_sgline(User *u, char *mask, const char *by, const time_t expires, const char *reason);
|
||||
E int add_sgline(User *u, const char *mask, const char *by, time_t expires, const char *reason);
|
||||
E int check_sgline(const char *nick, const char *realname);
|
||||
E void expire_sglines();
|
||||
|
||||
|
||||
+10
-6
@@ -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> ¶ms)
|
||||
{
|
||||
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)
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user