summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.c6
-rw-r--r--src/mail.c18
-rw-r--r--src/servers.c23
-rw-r--r--src/tools/smtp.h6
4 files changed, 26 insertions, 27 deletions
diff --git a/src/config.c b/src/config.c
index 566e62728..66b880163 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1532,7 +1532,7 @@ int parse_directive(Directive * d, char *dir, int ac, char *av[MAXPARAMS],
int parse(char *buf, int linenum, int reload)
{
char *s, *t, *dir;
- int n;
+ unsigned int n;
int retval = 1;
int ac = 0;
char *av[MAXPARAMS];
@@ -1621,7 +1621,7 @@ int read_config(int reload)
int defconCount = 0;
if (reload) {
- int i, n;
+ unsigned int i, n;
/* Reset all the reloadable settings */
@@ -1918,7 +1918,7 @@ int read_config(int reload)
DefCon[0] = 0;
for (int level = 1; level < 5; ++level) {
DefCon[level] = 0;
- std::string *levelDefinition;
+ std::string *levelDefinition = NULL;
switch (level) {
case 1:
levelDefinition = &DefCon1;
diff --git a/src/mail.c b/src/mail.c
index 408243cc4..0d66086c2 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -6,9 +6,9 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
+ * Based on the original code of Services by Andy Church.
+ *
+ * $Id$
*
*/
@@ -221,7 +221,7 @@ void MailReset(User * u, NickCore * nc)
/**
* Checks whether we have a valid, common e-mail address.
- * This is NOT entirely RFC compliant, and won't be so, because I said
+ * This is NOT entirely RFC compliant, and won't be so, because I said
* *common* cases. ;) It is very unlikely that e-mail addresses that
* are really being used will fail the check.
*
@@ -231,7 +231,7 @@ void MailReset(User * u, NickCore * nc)
*/
int MailValidate(const char *email)
{
- int i, j, has_period = 0, len;
+ int has_period = 0, len;
char copy[BUFSIZE], *domain;
static char specials[] =
@@ -254,20 +254,20 @@ int MailValidate(const char *email)
return 0;
/* Check for forbidden characters in the name */
- for (i = 0; i < strlen(copy); i++) {
+ for (unsigned int i = 0; i < strlen(copy); i++) {
if (copy[i] <= 31 || copy[i] >= 127)
return 0;
- for (j = 0; j < 13; j++)
+ for (unsigned int j = 0; j < 13; j++)
if (copy[i] == specials[j])
return 0;
}
/* Check for forbidden characters in the domain, and if it seems to be valid. */
- for (i = 0; i < (len = strlen(domain)); i++) {
+ for (int i = 0; i < (len = strlen(domain)); i++) {
if (domain[i] <= 31 || domain[i] >= 127)
return 0;
- for (j = 0; j < 13; j++)
+ for (unsigned int j = 0; j < 13; j++)
if (domain[i] == specials[j])
return 0;
if (domain[i] == '.') {
diff --git a/src/servers.c b/src/servers.c
index 554ec9f67..99309db00 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -110,14 +110,14 @@ Server *next_server(int flags)
* places in the linked list if a Server struct to it's uplink if provided.
* It can also be NULL to indicate it's the uplink and should be first in
* the server list.
- * @param uplink Server struct
+ * @param server_uplink Server struct
* @param name Server Name
* @param desc Server Description
* @param flags Server Flags, see services.h
* @param suid Server Universal ID
* @return Server Struct
*/
-Server *new_server(Server * uplink, const char *name, const char *desc,
+Server *new_server(Server * server_uplink, const char *name, const char *desc,
uint16 flags, const char *suid)
{
Server *serv;
@@ -128,7 +128,7 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
serv->name = sstrdup(name);
serv->desc = sstrdup(desc);
serv->flags = flags;
- serv->uplink = uplink;
+ serv->uplink = server_uplink;
if (suid) {
serv->suid = sstrdup(suid);
} else {
@@ -141,21 +141,21 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
serv->links = NULL;
serv->prev = NULL;
- if (!uplink) {
+ if (!server_uplink) {
serv->hops = 0;
serv->next = servlist;
if (servlist)
servlist->prev = serv;
servlist = serv;
} else {
- serv->hops = uplink->hops + 1;
- serv->next = uplink->links;
- if (uplink->links)
- uplink->links->prev = serv;
- uplink->links = serv;
+ serv->hops = server_uplink->hops + 1;
+ serv->next = server_uplink->links;
+ if (server_uplink->links)
+ server_uplink->links->prev = serv;
+ server_uplink->links = serv;
}
/* Check if this is our uplink server */
- if ((uplink == me_server) && !(flags & SERVER_JUPED))
+ if ((server_uplink == me_server) && !(flags & SERVER_JUPED))
serv_uplink = serv;
/* Write the StartGlobal (to non-juped servers) */
@@ -571,9 +571,6 @@ static unsigned int ts6_uid_index = 9; /* last slot in uid buf */
void ts6_uid_init(void)
{
- unsigned int i;
- char buf[BUFSIZE];
-
/* check just in case... you can never be too safe. */
if (TS6SID != NULL) {
snprintf(ts6_new_uid, 10, "%sAAAAAA", TS6SID);
diff --git a/src/tools/smtp.h b/src/tools/smtp.h
index 7a30cc0fe..a16be487a 100644
--- a/src/tools/smtp.h
+++ b/src/tools/smtp.h
@@ -6,8 +6,8 @@
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
+ * Based on the original code of Services by Andy Church.
+ *
*
*/
@@ -18,7 +18,9 @@
/* Some Linux boxes (or maybe glibc includes) require this for the
* prototype of strsignal(). */
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include <stdarg.h>
#include <stdio.h>