summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-07 18:39:57 -0400
committerAdam <Adam@anope.org>2010-09-07 18:39:57 -0400
commit3a97d196f9744a75a715cf3bc8bd0d36683e4ece (patch)
tree2774f41c34fdd2e5ce5a84262de2b42f665e5382
parent7dfc8e8ee8f5355429763eac70fe694bf947eca3 (diff)
Fixed make strict build and cleaned up some warnings
-rw-r--r--include/services.h1
-rw-r--r--src/core/cs_sendpass.c6
-rw-r--r--src/core/ns_register.c6
-rw-r--r--src/core/ns_sendpass.c6
-rw-r--r--src/hostserv.c1
-rw-r--r--src/ircd.c36
-rw-r--r--src/memoserv.c6
-rw-r--r--src/modules.c6
-rw-r--r--src/protocol/inspircd11.c2
-rw-r--r--src/tools/anopesmtp.c2
10 files changed, 36 insertions, 36 deletions
diff --git a/include/services.h b/include/services.h
index 666f25225..93e0561ea 100644
--- a/include/services.h
+++ b/include/services.h
@@ -87,6 +87,7 @@
#include <winsock.h>
#include <windows.h>
#endif
+#define h_addr h_addr_list[0] /* for backwards compatability, see man gethostbyname */
#include <sys/stat.h> /* for umask() on some systems */
#include <sys/types.h>
diff --git a/src/core/cs_sendpass.c b/src/core/cs_sendpass.c
index 90bab7a12..a0c7b8a59 100644
--- a/src/core/cs_sendpass.c
+++ b/src/core/cs_sendpass.c
@@ -95,7 +95,7 @@ int do_sendpass(User * u)
if (!mail)
return MOD_CONT;
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_HEAD));
+ fprintf(mail->pipe, "%s", getstring2(founder, CHAN_SENDPASS_HEAD));
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_1),
ci->name);
@@ -103,9 +103,9 @@ int do_sendpass(User * u)
fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_2),
tmp_pass);
fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_3));
+ fprintf(mail->pipe, "%s", getstring2(founder, CHAN_SENDPASS_LINE_3));
fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_4));
+ fprintf(mail->pipe, "%s", getstring2(founder, CHAN_SENDPASS_LINE_4));
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring2(founder, CHAN_SENDPASS_LINE_5),
NetworkName);
diff --git a/src/core/ns_register.c b/src/core/ns_register.c
index 9db168f9c..77080bdd5 100644
--- a/src/core/ns_register.c
+++ b/src/core/ns_register.c
@@ -472,16 +472,16 @@ int do_sendregmail(User * u, NickRequest * nr)
if (!mail) {
return -1;
}
- fprintf(mail->pipe, getstring2(NULL, NICK_REG_MAIL_HEAD));
+ fprintf(mail->pipe, "%s", getstring2(NULL, NICK_REG_MAIL_HEAD));
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring2(NULL, NICK_REG_MAIL_LINE_1), nr->nick);
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring2(NULL, NICK_REG_MAIL_LINE_2), s_NickServ,
nr->passcode);
fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(NULL, NICK_REG_MAIL_LINE_3));
+ fprintf(mail->pipe, "%s", getstring2(NULL, NICK_REG_MAIL_LINE_3));
fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(NULL, NICK_REG_MAIL_LINE_4));
+ fprintf(mail->pipe, "%s", getstring2(NULL, NICK_REG_MAIL_LINE_4));
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring2(NULL, NICK_REG_MAIL_LINE_5),
NetworkName);
diff --git a/src/core/ns_sendpass.c b/src/core/ns_sendpass.c
index 3916155dc..fc80895dc 100644
--- a/src/core/ns_sendpass.c
+++ b/src/core/ns_sendpass.c
@@ -92,16 +92,16 @@ int do_sendpass(User * u)
if (!mail)
return MOD_CONT;
- fprintf(mail->pipe, getstring(na, NICK_SENDPASS_HEAD));
+ fprintf(mail->pipe, "%s", getstring(na, NICK_SENDPASS_HEAD));
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_1), na->nick);
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_2),
tmp_pass);
fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_3));
+ fprintf(mail->pipe, "%s", getstring(na, NICK_SENDPASS_LINE_3));
fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_4));
+ fprintf(mail->pipe, "%s", getstring(na, NICK_SENDPASS_LINE_4));
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_5),
NetworkName);
diff --git a/src/hostserv.c b/src/hostserv.c
index b2dd0a81d..53b80fa1e 100644
--- a/src/hostserv.c
+++ b/src/hostserv.c
@@ -45,7 +45,6 @@ void moduleAddHostServCmds(void)
void get_hostserv_stats(long *nrec, long *memuse)
{
long count = 0, mem = 0;
- int i;
HostCore *hc;
for (hc = head; hc; hc = hc->next) {
diff --git a/src/ircd.c b/src/ircd.c
index 5128faed1..be2a1dc53 100644
--- a/src/ircd.c
+++ b/src/ircd.c
@@ -274,24 +274,24 @@ void anope_cmd_notice2(char *source, char *dest, char *msg)
void anope_cmd_action(char *source, char *dest, const char *fmt, ...)
{
- va_list args;
- char buf[BUFSIZE];
- char actionbuf[BUFSIZE];
- *buf = '\0';
- *actionbuf = '\0';
- if (fmt) {
- va_start(args, fmt);
- vsnprintf(buf, BUFSIZE - 1, fmt, args);
- va_end(args);
- } else {
- return;
- }
- if (!buf) {
- return;
- }
- snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s %c", 1, buf, 1);
- ircdproto.ircd_cmd_privmsg(source, dest, actionbuf);
- }
+ va_list args;
+ char buf[BUFSIZE];
+ char actionbuf[BUFSIZE];
+ *buf = '\0';
+ *actionbuf = '\0';
+ if (fmt) {
+ va_start(args, fmt);
+ vsnprintf(buf, BUFSIZE - 1, fmt, args);
+ va_end(args);
+ }
+
+ if (!*buf) {
+ return;
+ }
+ snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s %c", 1, buf, 1);
+ ircdproto.ircd_cmd_privmsg(source, dest, actionbuf);
+}
+
void anope_cmd_privmsg(char *source, char *dest, const char *fmt, ...)
{
va_list args;
diff --git a/src/memoserv.c b/src/memoserv.c
index 9d987665b..92a71ecb3 100644
--- a/src/memoserv.c
+++ b/src/memoserv.c
@@ -385,7 +385,7 @@ static void new_memo_mail(NickCore * nc, Memo * m)
fprintf(mail->pipe, getstring2(NULL, MEMO_MAIL_TEXT2), m->sender,
m->number);
fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring2(NULL, MEMO_MAIL_TEXT3));
+ fprintf(mail->pipe, "%s", getstring2(NULL, MEMO_MAIL_TEXT3));
fprintf(mail->pipe, "\n\n");
fprintf(mail->pipe, "%s", m->text);
fprintf(mail->pipe, "\n");
@@ -425,10 +425,10 @@ void rsend_notify(User * u, Memo * m, const char *chan)
nick or channel */
if (chan) {
fmt = getstring(na, MEMO_RSEND_CHAN_MEMO_TEXT);
- sprintf(text, fmt, chan);
+ snprintf(text, sizeof(text), fmt, chan);
} else {
fmt = getstring(na, MEMO_RSEND_NICK_MEMO_TEXT);
- sprintf(text, fmt);
+ snprintf(text, sizeof(text), "%s", fmt);
}
/* Send notification */
diff --git a/src/modules.c b/src/modules.c
index 6ce4d955a..7e7061647 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -299,7 +299,7 @@ void modules_unload_all(boolean fini, boolean unload_proto)
}
if ((ano_modclose(mh->m->handle)) != 0)
- alog(ano_moderr());
+ alog("%s", ano_moderr());
else
delModule(mh->m);
} else {
@@ -641,7 +641,7 @@ int loadModule(Module * m, User * u)
ano_modclearerr();
m->handle = ano_modopen(m->filename);
if ( m->handle == NULL && (err = ano_moderr()) != NULL) {
- alog(err);
+ alog("%s", err);
return MOD_ERR_NOLOAD;
}
ano_modclearerr();
@@ -760,7 +760,7 @@ int unloadModule(Module * m, User * u)
}
if ((ano_modclose(m->handle)) != 0) {
- alog(ano_moderr());
+ alog("%s", ano_moderr());
if (u) {
notice_lang(s_OperServ, u, OPER_MODULE_REMOVE_FAIL, m->name);
}
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index 799ecb3ac..6a28f9fda 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -900,7 +900,7 @@ void inspircd_cmd_pong(char *servname, char *who)
/* JOIN */
void inspircd_cmd_join(char *user, char *channel, time_t chantime)
{
- send_cmd(user, "JOIN %s %ld", channel, (unsigned int)chantime);
+ send_cmd(user, "JOIN %s %ld", channel, chantime);
}
/* UNSQLINE */
diff --git a/src/tools/anopesmtp.c b/src/tools/anopesmtp.c
index b54da9210..b091612c7 100644
--- a/src/tools/anopesmtp.c
+++ b/src/tools/anopesmtp.c
@@ -152,7 +152,7 @@ void alog(const char *fmt, ...)
time(&t);
tm = *localtime(&t);
strftime(buf, sizeof(buf) - 1, "[%b %d %H:%M:%S %Y] ", &tm);
- if (logfile && args) {
+ if (logfile) {
fputs(buf, logfile);
vfprintf(logfile, fmt, args);
fputc('\n', logfile);