summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base64.c4
-rw-r--r--src/chanserv.c19
-rw-r--r--src/config.c26
-rw-r--r--src/misc.c22
-rw-r--r--src/modules.c5
-rw-r--r--src/nickserv.c12
-rw-r--r--src/plexus.c3
-rw-r--r--src/unreal32.c2
8 files changed, 50 insertions, 43 deletions
diff --git a/src/base64.c b/src/base64.c
index 6eb8e57ac..df14f09b0 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -285,6 +285,7 @@ char *encode_ip(u_char * ip)
static char buf[25];
u_char *cp;
struct in_addr ia; /* For IPv4 */
+ char *s_ip; /* Signed ip string */
if (!ip)
return "*";
@@ -292,7 +293,8 @@ char *encode_ip(u_char * ip)
if (strchr((char *) ip, ':')) {
return NULL;
} else {
- ia.s_addr = inet_addr(ip);
+ s_ip = str_signed(ip);
+ ia.s_addr = inet_addr(s_ip);
cp = (u_char *) ia.s_addr;
b64_encode((char *) &cp, sizeof(struct in_addr), buf, 25);
}
diff --git a/src/chanserv.c b/src/chanserv.c
index 7a855e5ee..15c4df05e 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -741,10 +741,9 @@ void load_cs_dbase(void)
ci->levels = scalloc(2 * CA_SIZE, 1);
reset_levels(ci);
for (j = 0; j < n_levels; j++) {
+ SAFE(read_int16(&tmp16));
if (j < CA_SIZE)
- SAFE(read_int16(&ci->levels[j], f));
- else
- SAFE(read_int16(&tmp16, f));
+ ci->levels[j] = (int16) tmp16;
}
/* To avoid levels list silly hacks */
if (ver < 10)
@@ -775,7 +774,8 @@ void load_cs_dbase(void)
for (j = 0; j < ci->accesscount; j++) {
SAFE(read_int16(&ci->access[j].in_use, f));
if (ci->access[j].in_use) {
- SAFE(read_int16(&ci->access[j].level, f));
+ SAFE(read_int16(&tmp16, f));
+ ci->access[j].level = (int16) tmp16;
SAFE(read_string(&s, f));
if (s) {
if (ver >= 13)
@@ -900,8 +900,10 @@ void load_cs_dbase(void)
}
}
- SAFE(read_int16(&ci->memos.memocount, f));
- SAFE(read_int16(&ci->memos.memomax, f));
+ SAFE(read_int16(&tmp16, f));
+ ci->memos.memocount = (int16) tmp16;
+ SAFE(read_int16(&tmp16, f));
+ ci->memos.memomax = (int16) tmp16;
if (ci->memos.memocount) {
Memo *memos;
memos = scalloc(sizeof(Memo) * ci->memos.memocount, 1);
@@ -949,10 +951,9 @@ void load_cs_dbase(void)
n_ttb = tmp16;
ci->ttb = scalloc(2 * TTB_SIZE, 1);
for (j = 0; j < n_ttb; j++) {
+ SAFE(read_int16(&tmp16, f));
if (j < TTB_SIZE)
- SAFE(read_int16(&ci->ttb[j], f));
- else
- SAFE(read_int16(&tmp16, f));
+ ci->ttb[j] = (int16) tmp16;
}
for (j = n_ttb; j < TTB_SIZE; j++)
ci->ttb[j] = 0;
diff --git a/src/config.c b/src/config.c
index 5a68e0d99..80513547a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -41,9 +41,6 @@ static char *temp_userhost;
char *HelpChannel;
char *LogChannel;
-char *NetworkDomain;
-char **NetworkDomains;
-int DomainNumber;
char *NetworkName;
char *s_NickServ;
@@ -337,11 +334,7 @@ int NumUlines;
/* Deprecated directive (dep_) and value checking (chk_) functions: */
-static void dep_ListOpersOnly(void)
-{
- NSListOpersOnly = 1;
- CSListOpersOnly = 1;
-}
+/* Hey, there are no left! -GD */
/*************************************************************************/
@@ -486,8 +479,6 @@ Directive directives[] = {
{"KillClonesAkillExpire",
{{PARAM_TIME, PARAM_RELOAD, &KillClonesAkillExpire}}},
{"LimitSessions", {{PARAM_SET, PARAM_FULLONLY, &LimitSessions}}},
- {"ListOpersOnly",
- {{PARAM_DEPRECATED, PARAM_RELOAD, dep_ListOpersOnly}}},
{"LocalAddress", {{PARAM_STRING, 0, &LocalHost},
{PARAM_PORT, PARAM_OPTIONAL, &LocalPort}}},
{"LogUsers", {{PARAM_SET, PARAM_RELOAD, &LogUsers}}},
@@ -518,7 +509,6 @@ Directive directives[] = {
{"MSNotifyAll", {{PARAM_SET, PARAM_RELOAD, &MSNotifyAll}}},
{"MSSendDelay", {{PARAM_TIME, PARAM_RELOAD, &MSSendDelay}}},
{"MSMemoReceipt", {{PARAM_POSINT, PARAM_RELOAD, &MSMemoReceipt}}},
- {"NetworkDomain", {{PARAM_STRING, PARAM_RELOAD, &NetworkDomain}}},
{"NetworkName", {{PARAM_STRING, PARAM_RELOAD, &NetworkName}}},
{"NewsCount", {{PARAM_POSINT, PARAM_RELOAD, &NewsCount}}},
{"NewsDB", {{PARAM_STRING, PARAM_RELOAD, &NewsDBName}}},
@@ -1385,20 +1375,6 @@ int read_config(int reload)
NSRExpire = 0;
}
- /* Network Domain building */
- DomainNumber = 0;
- if (NetworkDomain) {
- s = strtok(NetworkDomain, " ");
- if (s) {
- do {
- DomainNumber++;
- NetworkDomains =
- realloc(NetworkDomains, sizeof(char *) * DomainNumber);
- NetworkDomains[DomainNumber - 1] = sstrdup(s);
- } while ((s = strtok(NULL, " ")));
- }
- }
-
if (!retval) {
printf
("\n*** Support resources: Read through the services.conf self-contained \n*** documentation. Read the documentation files found in the 'docs' \n*** folder. Visit our portal located at http://www.anope.org/. Join \n*** our support channel on /server irc.anope.org channel #anope.\n\n");
diff --git a/src/misc.c b/src/misc.c
index 0b2d5af10..1d011ece5 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1103,4 +1103,26 @@ char *host_resolve(char *host)
}
}
+/*************************************************************************/
+
+/**
+ * Change an unsigned string to a signed string, overwriting the original
+ * string.
+ * @param input string
+ * @return output string, same as input string.
+ */
+
+char *str_signed(u_char *str)
+{
+ char *nstr;
+
+ nstr = (char *)str;
+ while (*str) {
+ *nstr = (char)*str;
+ str++; nstr++;
+ }
+
+ return nstr;
+}
+/* EOF */
diff --git a/src/modules.c b/src/modules.c
index ff34ed361..107cf0bfa 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -337,10 +337,11 @@ int loadModule(Module * m, User * u)
strncpy(buf, MODULE_PATH, 4095); /* Get full path with .so extension */
len = strlen(buf);
strncat(buf, "runtime/", 4095 - len);
- len += strlen(buf);
+ len = strlen(buf);
strncat(buf, m->name, 4095 - len);
- len += strlen(buf);
+ len = strlen(buf);
strncat(buf, ".so", 4095 - len);
+ buf[4095] = '\0';
m->filename = sstrdup(buf);
#ifdef HAS_RTLD_LOCAL
diff --git a/src/nickserv.c b/src/nickserv.c
index d0a53bd72..5cc4c48d9 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -543,8 +543,10 @@ void load_old_ns_dbase(void)
SAFE(read_string(access, f));
}
- SAFE(read_int16(&nc->memos.memocount, f));
- SAFE(read_int16(&nc->memos.memomax, f));
+ SAFE(read_int16(&tmp16, f));
+ nc->memos.memocount = (int16) tmp16;
+ SAFE(read_int16(&tmp16, f));
+ nc->memos.memomax = (int16) tmp16;
if (nc->memos.memocount) {
Memo *memos;
memos = scalloc(sizeof(Memo) * nc->memos.memocount, 1);
@@ -741,8 +743,10 @@ void load_ns_dbase(void)
SAFE(read_string(access, f));
}
- SAFE(read_int16(&nc->memos.memocount, f));
- SAFE(read_int16(&nc->memos.memomax, f));
+ SAFE(read_int16(&tmp16, f));
+ nc->memos.memocount = (int16) tmp16;
+ SAFE(read_int16(&tmp16, f));
+ nc->memos.memomax = (int16) tmp16;
if (nc->memos.memocount) {
Memo *memos;
memos = scalloc(sizeof(Memo) * nc->memos.memocount, 1);
diff --git a/src/plexus.c b/src/plexus.c
index 20126b337..ddd7f5300 100644
--- a/src/plexus.c
+++ b/src/plexus.c
@@ -1353,10 +1353,11 @@ void anope_cmd_squit(char *servname, char *message)
int anope_event_mode(char *source, int ac, char **av)
{
+ Server *s;
+
if (ac < 2)
return MOD_CONT;
- Server *s;
s = findserver(servlist, source);
if (*av[0] == '#' || *av[0] == '&') {
diff --git a/src/unreal32.c b/src/unreal32.c
index 91485949a..a19ec5576 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -1506,7 +1506,7 @@ int anope_event_netinfo(char *source, int ac, char **av)
void anope_cmd_netinfo(int ac, char **av)
{
send_cmd(NULL, "%s %ld %ld %d %s 0 0 0 :%s",
- send_token("NETINFO", "AO"), maxusercnt,
+ send_token("NETINFO", "AO"), (long int) maxusercnt,
(long int) time(NULL), atoi(av[2]), av[3], av[7]);
}