1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 21:03:14 +02:00

- code cleanup / misc minor bugfixes (MyMalloc, oper msgs)

This commit is contained in:
Bram Matthys
2003-04-12 15:56:25 +00:00
parent 3a368be7e5
commit 406ba755d6
11 changed files with 17 additions and 16 deletions
+1
View File
@@ -2035,3 +2035,4 @@ seen. gmtime warning still there
- Added allow::options::ssl and allow::options::nopasscont, requested by iguy and Scytale.
- Removed usermode +b from docs (been gone for a long time) (#0000798) reported by Rocko
- Fixed an SQLINE bug
- code cleanup / misc minor bugfixes (MyMalloc, oper msgs)
+1 -1
View File
@@ -172,7 +172,7 @@ char *hidehost(char *rhost)
int i;
char *p, *q;
host = malloc(strlen(rhost)+1);
host = MyMalloc(strlen(rhost)+1);
q = host;
for (p = rhost; *p; p++, q++) {
*q = tolower(*p);
+1 -1
View File
@@ -779,7 +779,7 @@ void add_throttling_bucket(struct IN_ADDR *in)
int hash;
struct ThrottlingBucket *n;
n = malloc(sizeof(struct ThrottlingBucket));
n = MyMalloc(sizeof(struct ThrottlingBucket));
n->next = n->prev = NULL;
bcopy(in, &n->in, sizeof(struct IN_ADDR));
n->since = TStime();
+1 -1
View File
@@ -245,7 +245,7 @@ void free_user(anUser *user, aClient *cptr)
*/
if (user->joined || user->refcnt < 0 ||
user->invited || user->channel)
sendto_ops("* %#x user (%s!%s@%s) %#x %#x %#x %d %d *",
sendto_realops("* %#x user (%s!%s@%s) %#x %#x %#x %d %d *",
cptr, cptr ? cptr->name : "<noname>",
user->username, user->realhost, user,
user->invited, user->channel, user->joined,
+2 -2
View File
@@ -62,7 +62,7 @@ Module *Module_make(ModuleHeader *header,
);
#ifdef UNDERSCORE
void *obsd_dlsym(void *handle, char *symbol) {
char *obsdsymbol = (char*)malloc(strlen(symbol) + 2);
char *obsdsymbol = (char*)MyMalloc(strlen(symbol) + 2);
void *symaddr = NULL;
if (obsdsymbol) {
@@ -127,7 +127,7 @@ char *Module_Create(char *path_)
if(!strchr(path, '/'))
{
path = malloc(strlen(path) + 3);
path = MyMalloc(strlen(path) + 3);
strcpy(path, "./");
strcat(path, path_);
}
+1 -1
View File
@@ -1054,7 +1054,7 @@ struct hostent *get_res(char *lp,long id)
a = proc_answer(rptr, hptr, buf, buf + rc);
if (a == -1)
{
sendto_ops("Bad hostname returned from %s for %s",
sendto_snomask(SNO_JUNK, "Bad hostname returned from %s for %s",
inet_ntoa(sin.sin_addr),
Inet_ia2p((struct IN_ADDR *)&rptr->he.h_addr));
Debug((DEBUG_DNS, "Bad hostname returned from %s for %s",
+1 -1
View File
@@ -75,7 +75,7 @@ void start_auth(aClient *cptr)
}
if (++OpenFiles >= (MAXCONNECTIONS - 2))
{
sendto_ops("Can't allocate fd for auth on %s, too many connections.", get_client_name(cptr, TRUE));
sendto_ops("Can't allocate fd, too many connections.");
CLOSE_SOCK(cptr->authfd);
--OpenFiles;
cptr->authfd = -1;
+3 -3
View File
@@ -1045,7 +1045,7 @@ void set_sock_opts(int fd, aClient *cptr)
for (*readbuf = '\0'; opt > 0; opt--, s += 3)
(void)ircsprintf(s, "%2.2x:", *t++);
*s = '\0';
sendto_ops("Connection %s using IP opts: (%s)",
sendto_realops("Connection %s using IP opts: (%s)",
get_client_name(cptr, TRUE), readbuf);
}
if (setsockopt(fd, IPPROTO_IP, IP_OPTIONS, (OPT_TYPE *)NULL,
@@ -1820,7 +1820,7 @@ int read_message(time_t delay, fdlist *listp)
if (++OpenFiles >= MAXCLIENTS)
{
ircstp->is_ref++;
sendto_ops("All connections in use. (%s)",
sendto_realops("All connections in use. (%s)",
get_client_name(cptr, TRUE));
#ifndef INET6
(void)send(fd,
@@ -2221,7 +2221,7 @@ int read_message(time_t delay, fdlist *listp)
if (fd >= MAXCLIENTS)
{
ircstp->is_ref++;
sendto_ops("All connections in use. (%s)",
sendto_realops("All connections in use. (%s)",
get_client_name(cptr, TRUE));
(void)send(fd,
"ERROR :All connections in use\r\n", 32, 0);
+3 -3
View File
@@ -4366,7 +4366,7 @@ int _test_badword(ConfigFile *conf, ConfigEntry *ce) {
errorcode = regcomp(&expr, word->ce_vardata, REG_ICASE);
else
{
tmpbuf = malloc(strlen(word->ce_vardata) +
tmpbuf = MyMalloc(strlen(word->ce_vardata) +
strlen(PATTERN) -1);
ircsprintf(tmpbuf, PATTERN, word->ce_vardata);
errorcode = regcomp(&expr, tmpbuf, REG_ICASE);
@@ -4374,7 +4374,7 @@ int _test_badword(ConfigFile *conf, ConfigEntry *ce) {
if (errorcode > 0)
{
errorbufsize = regerror(errorcode, &expr, NULL, 0)+1;
errorbuf = malloc(errorbufsize);
errorbuf = MyMalloc(errorbufsize);
regerror(errorcode, &expr, errorbuf, errorbufsize);
config_error("%s:%i: badword::%s contains an invalid regex: %s",
word->ce_fileptr->cf_filename,
@@ -5901,7 +5901,7 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
if (errorcode > 0)
{
errorbufsize = regerror(errorcode, &expr, NULL, 0)+1;
errorbuf = malloc(errorbufsize);
errorbuf = MyMalloc(errorbufsize);
regerror(errorcode, &expr, errorbuf, errorbufsize);
config_error("%s:%i: alias::format contains an invalid regex: %s",
cep->ce_fileptr->cf_filename,
+2 -2
View File
@@ -724,7 +724,7 @@ errlink:
"ERROR :Server %s already exists from %s",
servername,
(ocptr->from ? ocptr->from->name : "<nobody>"));
sendto_ops
sendto_realops
("Link %s cancelled, server %s already exists from %s",
get_client_name(acptr, TRUE), servername,
(ocptr->from ? ocptr->from->name : "<nobody>"));
@@ -911,7 +911,7 @@ CMD_FUNC(m_server_remote)
"ERROR :Server %s already exists from %s",
servername,
(ocptr->from ? ocptr->from->name : "<nobody>"));
sendto_ops
sendto_realops
("Link %s cancelled, server %s already exists from %s",
get_client_name(acptr, TRUE), servername,
(ocptr->from ? ocptr->from->name : "<nobody>"));
+1 -1
View File
@@ -279,7 +279,7 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
int i = 0, j = 0, k = 1;
char output[501];
char nums[4];
char *current = malloc(strlen(parv[1])+1);
char *current = MyMalloc(strlen(parv[1])+1);
char *xparv[3];
bzero(current, strlen(parv[1])+1);
bzero(output, sizeof output);