reguser *rup;
activeuser* aup;
nick *sender=source;
- nicklist *nl;
+ nicklist *nl = NULL;
char userhost[USERLEN+HOSTLEN+2];
int ucount=0;
char tokens[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789[]";
-/* Moved into include file
-long numerictolong(const char *numeric, int numericlen)
+INLINE long numerictolong(const char *numeric, int numericlen)
{
long mynumeric=0;
int i;
return mynumeric;
}
-*/
char *longtonumeric(long param, int len)
{
if(!lua_isstring(l, 1))
return 0;
+ acc = lua_tostring(l, 1);
+
for(i=0;i<NICKHASHSIZE;i++) {
for(np=nicktable[i];np;np=np->next) {
if(np && np->authname && !ircd_strcmp(np->authname, acc)) {
/* @test */
int noperserv_hello(void *sender, int cargc, char **cargv) {
- char *newaccount;
+ char *newaccount = NULL;
no_autheduser *au;
int i;
nick *np = (nick *)sender, *np2, *target = NULL;
}
int nterfacer_new_rline(char *line, struct esocket *socket, int *number) {
- char *sp, *p, *parsebuf, *pp, commandbuf[MAX_BUFSIZE], *args[MAX_ARGS], *newp;
+ char *sp, *p, *parsebuf = NULL, *pp, commandbuf[MAX_BUFSIZE], *args[MAX_ARGS], *newp;
int argcount;
struct service_node *service;
struct rline *prequest;
*newp = '\0';
}
if(argcount < hl->args) {
- if(argcount)
+ if(argcount && parsebuf)
free(parsebuf);
return RE_WRONG_ARG_COUNT;
}
prequest = (struct rline *)malloc(sizeof(struct rline));
if(!prequest) {
MemError();
- if(argcount)
+ if(argcount && parsebuf)
free(parsebuf);
return RE_MEM_ERROR;
}
rlines = prequest;
re = (hl->function)(prequest, argcount, args);
- if(argcount)
+ if(argcount && parsebuf)
free(parsebuf);
return re;
struct rg_struct *rg_newsstruct(char *id, char *mask, char *setby, char *reason, char *expires, char *type, time_t iexpires, int iid) {
struct rg_struct *newrow, *lp, *cp;
time_t rexpires;
+ int stupidwarning;
char glineiddata[1024];
if (iexpires == 0) {
- if(!protectedatoi(expires, (int *)&rexpires))
+ if(!protectedatoi(expires, &stupidwarning))
return NULL;
+ rexpires = (time_t)stupidwarning;
} else {
rexpires = iexpires;
}
void rg_dogline(struct rg_glinelist *gll, nick *np, struct rg_struct *rp, char *matched) { /* PPA: if multiple users match the same user@host or *@host it'll send multiple glines?! */
char hostname[RG_MASKLEN];
- int usercount;
+ int usercount = 0;
rg_loggline(rp, np);
if (rp->type == 1) {
nick *tnp;
- for(usercount=0,tnp=np->host->nicks;tnp;tnp=tnp->nextbyhost)
+ for(tnp=np->host->nicks;tnp;tnp=tnp->nextbyhost)
if(!ircd_strcmp(np->ident, tnp->ident))
usercount++;
void trojanscan_watch_clone_update(struct trojanscan_prechannels *hp, int count) {
int i, j, marked;
struct trojanscan_prechannels *lp;
- struct trojanscan_templist *markedlist;
+ struct trojanscan_templist *markedlist = NULL;
if(count > 0) {
markedlist = (struct trojanscan_templist *)calloc(count, sizeof(struct trojanscan_templist));
for(i=0;i<trojanscan_activechans;i++) {
marked = 0;
- for(lp=hp,j=0;j<count&&lp;j++,lp=lp->next) {
- if(!markedlist[j].active && !lp->exempt && !ircd_strcmp(lp->name->content, trojanscan_chans[i].channel->content)) { /* we're already on the channel */
- if(trojanscan_chans[i].watch_clone) {
- markedlist[j].active = 1;
- markedlist[j].watch_clone = trojanscan_chans[i].watch_clone;
- lp->watch_clone = trojanscan_chans[i].watch_clone;
+ if(markedlist) {
+ for(lp=hp,j=0;j<count&&lp;j++,lp=lp->next) {
+ if(!markedlist[j].active && !lp->exempt && !ircd_strcmp(lp->name->content, trojanscan_chans[i].channel->content)) { /* we're already on the channel */
+ if(trojanscan_chans[i].watch_clone) {
+ markedlist[j].active = 1;
+ markedlist[j].watch_clone = trojanscan_chans[i].watch_clone;
+ lp->watch_clone = trojanscan_chans[i].watch_clone;
+ }
+ marked = 1;
+ break;
}
- marked = 1;
- break;
}
}
if(!marked && trojanscan_chans[i].watch_clone) {
}
}
+ if(!markedlist)
+ return;
+
for(j=0,lp=hp;j<count&&lp;j++,lp=lp->next) {
if((!markedlist[j].active || !markedlist[j].watch_clone) && !lp->exempt) {
channel *cp = findchannel(lp->name->content);