summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:08 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:08 +0000
commitd73f104182c4964409f98f176a66d6a73ea2b7e1 (patch)
tree2666d131c6f8c2e7e88b084e17657e85547b99d1 /src/main.c
parent12ef623e94b5b1e668739c083eab3e045cf0b3f3 (diff)
Fix for g++
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1176 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index e2927b283..320438054 100644
--- a/src/main.c
+++ b/src/main.c
@@ -354,8 +354,7 @@ void sighandler(int signum)
save_databases();
if (!read_config(1)) {
- sprintf(quitmsg,
- "Error Reading Configuration File (Received SIGUSR2)");
+ quitmsg = "Error Reading Configuration File (Received SIGUSR2)";
quitting = 1;
}
send_event(EVENT_RELOAD, 1, EVENT_START);
@@ -480,15 +479,15 @@ void sighandler(int signum)
#ifndef _WIN32
signum == SIGUSR1 ||
#endif
- !(quitmsg = calloc(BUFSIZE, 1))) {
+ !(quitmsg = (const char *)calloc(BUFSIZE, 1))) {
quitmsg = "Out of memory!";
} else {
+
+ // Yes, this isn't the "nicest" of ideas, but we know it's safe, if bad practice. -- w00t
#if HAVE_STRSIGNAL
- snprintf(quitmsg, BUFSIZE, "Services terminating: %s",
- strsignal(signum));
+ snprintf((char *)quitmsg, BUFSIZE, "Services terminating: %s", strsignal(signum));
#else
- snprintf(quitmsg, BUFSIZE, "Services terminating on signal %d",
- signum);
+ snprintf((char *)quitmsg, BUFSIZE, "Services terminating on signal %d", signum);
#endif
}
@@ -656,9 +655,10 @@ int main(int ac, char **av, char **envp)
process();
} else if (i == 0) {
int errno_save = errno;
- quitmsg = scalloc(BUFSIZE, 1);
+ quitmsg = (const char *)scalloc(BUFSIZE, 1);
if (quitmsg) {
- snprintf(quitmsg, BUFSIZE,
+ // Naughty, but oh well. :)
+ snprintf((char *)quitmsg, BUFSIZE,
"Read error from server: %s (error num: %d)",
strerror(errno_save), errno_save);
} else {