diff options
author | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-10-13 05:22:13 +0000 |
---|---|---|
committer | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-10-13 05:22:13 +0000 |
commit | 3fb17634a05f1bd4155d2b7fd851c91fc516d1df (patch) | |
tree | 17fd46a3f19e3f8682693755a5636fc7144999ca | |
parent | ee5de492f765f02b09fee772540017fb5ea1007e (diff) |
BUILD : 1.7.5 (392) BUGS : N/A NOTES : More code tidy with strict enabled, some clean up of Unreal32
git-svn-id: svn://svn.anope.org/anope/trunk@392 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@257 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | src/channels.c | 5 | ||||
-rw-r--r-- | src/config.c | 12 | ||||
-rw-r--r-- | src/memory.c | 2 | ||||
-rw-r--r-- | src/misc.c | 12 | ||||
-rw-r--r-- | src/modules.c | 12 | ||||
-rw-r--r-- | src/nickserv.c | 10 | ||||
-rw-r--r-- | src/operserv.c | 7 | ||||
-rw-r--r-- | src/timeout.c | 4 | ||||
-rw-r--r-- | src/unreal32.c | 24 | ||||
-rw-r--r-- | src/users.c | 2 | ||||
-rw-r--r-- | version.log | 6 |
12 files changed, 65 insertions, 32 deletions
diff --git a/include/extern.h b/include/extern.h index e217e5a88..f1af80101 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1098,6 +1098,7 @@ extern long base64dects(char *ts); #define Anope_Free(x) if ((x) != NULL) free(x) extern char *host_resolve(char *host); +extern char *anopeStrDup(const char *src); #endif /* EXTERN_H */ diff --git a/src/channels.c b/src/channels.c index b331f6c31..1965edfe2 100644 --- a/src/channels.c +++ b/src/channels.c @@ -321,7 +321,7 @@ Channel *findchan(const char *chan) c = c->next; } if (debug >= 3) - alog("debug: findchan(%s) -> %p", chan, c); + alog("debug: findchan(%s) -> %p", chan, (void *) c); return NULL; } @@ -660,8 +660,7 @@ void do_sjoin(const char *source, int ac, char **av) { Channel *c; User *user; - char *s, *end, cubuf[ircd->max_symbols + 2], *end2, - *cumodes[ircd->max_symbols + 1]; + char *s, *end, cubuf[7], *end2, *cumodes[6]; int is_sqlined = 0; diff --git a/src/config.c b/src/config.c index 161197966..a3b2368b7 100644 --- a/src/config.c +++ b/src/config.c @@ -825,7 +825,7 @@ int parse(char *buf, int linenum, int reload) case PARAM_STRING: /* if (reload && *(char **)d->params[i].ptr) free(*(char **)d->params[i].ptr); */ - *(char **) d->params[i].ptr = strdup(av[optind++]); + *(char **) d->params[i].ptr = anopeStrDup(av[optind++]); if (!d->params[i].ptr) { error(linenum, "%s: Out of memory", d->name); return 0; @@ -1182,7 +1182,7 @@ int read_config(int reload) RootNumber++; ServicesRoots = realloc(ServicesRoots, sizeof(char *) * RootNumber); - ServicesRoots[RootNumber - 1] = strdup(s); + ServicesRoots[RootNumber - 1] = anopeStrDup(s); } while ((s = strtok(NULL, " "))); } @@ -1195,7 +1195,7 @@ int read_config(int reload) HostNumber++; HostSetters = realloc(HostSetters, sizeof(char *) * HostNumber); - HostSetters[HostNumber - 1] = strdup(s); + HostSetters[HostNumber - 1] = anopeStrDup(s); } } while ((s = strtok(NULL, " "))); } @@ -1210,7 +1210,7 @@ int read_config(int reload) ModulesAutoload = realloc(ModulesAutoload, sizeof(char *) * ModulesNumber); - ModulesAutoload[ModulesNumber - 1] = strdup(s); + ModulesAutoload[ModulesNumber - 1] = anopeStrDup(s); } } while ((s = strtok(NULL, " "))); } @@ -1225,7 +1225,7 @@ int read_config(int reload) realloc(ModulesDelayedAutoload, sizeof(char *) * ModulesDelayedNumber); ModulesDelayedAutoload[ModulesDelayedNumber - 1] = - strdup(s); + anopeStrDup(s); } } while ((s = strtok(NULL, " "))); } @@ -1365,7 +1365,7 @@ int read_config(int reload) DomainNumber++; NetworkDomains = realloc(NetworkDomains, sizeof(char *) * DomainNumber); - NetworkDomains[DomainNumber - 1] = strdup(s); + NetworkDomains[DomainNumber - 1] = anopeStrDup(s); } while ((s = strtok(NULL, " "))); } } diff --git a/src/memory.c b/src/memory.c index 25c9bd328..41e4a16ca 100644 --- a/src/memory.c +++ b/src/memory.c @@ -77,7 +77,7 @@ void *srealloc(void *oldptr, long newsize) char *sstrdup(const char *s) { - char *t = strdup(s); + char *t = anopeStrDup(s); if (!t) #if !defined(USE_THREADS) || !defined(LINUX20) raise(SIGUSR1); diff --git a/src/misc.c b/src/misc.c index 4820a9fae..e3bcd899d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -896,7 +896,7 @@ char *host_resolve(char *host) memcpy(&ip, hentp->h_addr, sizeof(hentp->h_length)); addr.s_addr = ip; ntoa(addr, ipbuf, sizeof(ipbuf)); - ipreturn = strdup(ipbuf); + ipreturn = anopeStrDup(ipbuf); if (debug) { alog("Resolved %s to %s",host, ipbuf); } @@ -907,3 +907,13 @@ char *host_resolve(char *host) } } +char *anopeStrDup(const char *src) { + char *ret=NULL; + if(src) { + if( (ret = (char *)malloc(strlen(src)+1)) ) {; + strcpy(ret,src); + } + } + return ret; +} + diff --git a/src/modules.c b/src/modules.c index f764fab1d..ce353e5b2 100644 --- a/src/modules.c +++ b/src/modules.c @@ -801,7 +801,7 @@ int displayCommand(Command * c) int i = 0; alog("Displaying command list for %s", c->name); for (cmd = c; cmd; cmd = cmd->next) { - alog("%d: %p", ++i, cmd); + alog("%d: 0x%p", ++i, (void *) cmd); } alog("end"); return 0; @@ -844,7 +844,7 @@ int displayMessage(Message * m) int i = 0; alog("Displaying message list for %s", m->name); for (msg = m; msg; msg = msg->next) { - alog("%d: %p", ++i, msg); + alog("%d: 0x%p", ++i, (void *) msg); } alog("end"); return 0; @@ -886,7 +886,7 @@ int addCommand(CommandHash * cmdTable[], Command * c, int pos) c->next = current->c; current->c = c; if (debug) - alog("existing cmd: (%p), new cmd (%p)", c->next, c); + alog("existing cmd: (%p), new cmd (0x%p)", c->next, (void *) c); return MOD_ERR_OK; } else if (pos == 2) { @@ -894,7 +894,7 @@ int addCommand(CommandHash * cmdTable[], Command * c, int pos) while (tail->next) tail = tail->next; if (debug) - alog("existing cmd: (%p), new cmd (%p)", tail, c); + alog("existing cmd: (%p), new cmd (0x%p)", tail, (void *) c); tail->next = c; c->next = NULL; @@ -1108,14 +1108,14 @@ int addMessage(MessageHash * msgTable[], Message * m, int pos) m->next = current->m; current->m = m; if (debug) - alog("existing msg: (%p), new msg (%p)", m->next, m); + alog("existing msg: (%p), new msg (0x%p)", m->next, (void *) m); return MOD_ERR_OK; } else if (pos == 2) { tail = current->m; while (tail->next) tail = tail->next; if (debug) - alog("existing msg: (%p), new msg (%p)", tail, m); + alog("existing msg: (%p), new msg (0x%p)", tail, (void *) m); tail->next = m; m->next = NULL; return MOD_ERR_OK; diff --git a/src/nickserv.c b/src/nickserv.c index d14472099..94c2d0163 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -1854,8 +1854,8 @@ void add_ns_timeout(NickAlias * na, int type, time_t delay) else if (type == TO_RELEASE) timeout_routine = timeout_release; else { - alog("NickServ: unknown timeout type %d! na=%p (%s), delay=%ld", - type, na, na->nick, delay); + alog("NickServ: unknown timeout type %d! na=0x%p (%s), delay=%ld", + type, (void *) na, na->nick, delay); return; } @@ -2243,11 +2243,11 @@ static int do_confirm(User * u) return MOD_CONT; } memset(pass, 0, strlen(pass)); - na->status = NS_IDENTIFIED | NS_RECOGNIZED; + na->status = (int16) (NS_IDENTIFIED | NS_RECOGNIZED); na->nc->flags |= NI_ENCRYPTEDPW; #else na->nc->pass = sstrdup(pass); - na->status = NS_IDENTIFIED | NS_RECOGNIZED; + na->status = (int16) (NS_IDENTIFIED | NS_RECOGNIZED); #endif na->nc->flags |= NSDefFlags; for (i = 0; i < RootNumber; i++) { @@ -2394,7 +2394,7 @@ static int do_group(User * u) common_get_vhost(u)); na->last_realname = sstrdup(u->realname); na->time_registered = na->last_seen = time(NULL); - na->status = NS_IDENTIFIED | NS_RECOGNIZED; + na->status = (int16) (NS_IDENTIFIED | NS_RECOGNIZED); if (!(na->nc->flags & NI_SERVICES_ROOT)) { for (i = 0; i < RootNumber; i++) { diff --git a/src/operserv.c b/src/operserv.c index 49656ee24..a7f5962a6 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -1735,6 +1735,8 @@ static int do_clearmodes(User * u) free(bans); + excepts = NULL; + if (ircd->except) { /* Clear excepts */ exceptcount = c->exceptcount; @@ -1751,8 +1753,9 @@ static int do_clearmodes(User * u) free(argv[1]); free(argv[0]); } - - free(excepts); + if (excepts) { + free(excepts); + } } if (ircd->invitemode) { diff --git a/src/timeout.c b/src/timeout.c index b2d91a4e6..74f453d99 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -60,8 +60,8 @@ void check_timeouts(void) continue; } if (debug >= 4) { - alog("debug: Running timeout %p (code=%p repeat=%d)", - to, to->code, to->repeat); + alog("debug: Running timeout 0x%p (code=0x%p repeat=%d)", + (void *) to, to->code, to->repeat); } to->code(to); if (to->repeat) { diff --git a/src/unreal32.c b/src/unreal32.c index 406629570..f6ee7f54d 100644 --- a/src/unreal32.c +++ b/src/unreal32.c @@ -455,7 +455,7 @@ void anope_set_umode(User * user, int ac, char **av) void moduleAddIRCDMsgs(void) { Message *m; - m = createMessage("401", NULL); addCoreMessage(IRCD,m); + m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); m = createMessage("451", anope_event_null); addCoreMessage(IRCD,m); m = createMessage("461", anope_event_null); addCoreMessage(IRCD,m); @@ -464,6 +464,9 @@ void moduleAddIRCDMsgs(void) { m = createMessage("6", anope_event_away); addCoreMessage(IRCD,m); } m = createMessage("INVITE", anope_event_null); addCoreMessage(IRCD,m); + if (UseTokens) { + m = createMessage("*", anope_event_null); addCoreMessage(IRCD,m); + } m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("C", anope_event_join); addCoreMessage(IRCD,m); @@ -632,8 +635,10 @@ void moduleAddIRCDMsgs(void) { if (UseTokens) { m = createMessage("5", anope_event_error); addCoreMessage(IRCD,m); } - /* SMO has no token */ m = createMessage("SMO", anope_event_smo); addCoreMessage(IRCD,m); + if (UseTokens) { + m = createMessage("AU", anope_event_smo); addCoreMessage(IRCD,m); + } m = createMessage("UMODE2", anope_event_umode2); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("|", anope_event_umode2); addCoreMessage(IRCD,m); @@ -662,7 +667,6 @@ void moduleAddIRCDMsgs(void) { if (UseTokens) { m = createMessage("AG", anope_event_sdesc); addCoreMessage(IRCD,m); } - m = createMessage("HTM", anope_event_null); addCoreMessage(IRCD,m); if (UseTokens) { m = createMessage("BH", anope_event_null); addCoreMessage(IRCD,m); @@ -683,6 +687,15 @@ void moduleAddIRCDMsgs(void) { if (UseTokens) { m = createMessage("AM", anope_event_null); addCoreMessage(IRCD,m); } + m = createMessage("SENDSNO", anope_event_null); addCoreMessage(IRCD,m); + if (UseTokens) { + m = createMessage("Ss", anope_event_null); addCoreMessage(IRCD,m); + } + m = createMessage("SENDUMODE", anope_event_null); addCoreMessage(IRCD,m); + if (UseTokens) { + m = createMessage("AP", anope_event_null); addCoreMessage(IRCD,m); + } + /* The none token version of these is in messages.c */ if (UseTokens) { @@ -1965,9 +1978,12 @@ int anope_event_smo(char *source, int ac, char **av) parv[3] - (optional) channel key(s) - current we do not support the keys part */ +/* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken + when coming from a none TOKEN'd server +*/ void anope_cmd_svsjoin(char *source, char *nick, char *chan) { - send_cmd(source, "%s %s :%s", send_token("SVSJOIN", "BR"), nick, chan); + send_cmd(source, "%s %s :%s", send_token("SVSJOIN", "BX"), nick, chan); } /* svspart diff --git a/src/users.c b/src/users.c index 2f507311d..40a4decfc 100644 --- a/src/users.c +++ b/src/users.c @@ -326,7 +326,7 @@ User *finduser(const char *nick) while (user && stricmp(user->nick, nick) != 0) user = user->next; if (debug >= 3) - alog("debug: finduser(%s) -> %p", nick, user); + alog("debug: finduser(%s) -> 0x%p", nick, (void *) user); return user; } diff --git a/version.log b/version.log index 5b3bbdedc..6fb65d2c3 100644 --- a/version.log +++ b/version.log @@ -8,10 +8,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="5" -VERSION_BUILD="391" +VERSION_BUILD="392" # $Log$ # +# BUILD : 1.7.5 (392) +# BUGS : N/A +# NOTES : More code tidy with strict enabled, some clean up of Unreal32 +# # BUILD : 1.7.5 (391) # BUGS : N/A # NOTES : Code tidy, added make strict to the makefile, allowing ansi Wall pedantic to be used for compiling |