From af56eb8e61d948b0b10793fae29461f6eed805c7 Mon Sep 17 00:00:00 2001 From: "certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Wed, 2 Aug 2006 10:07:36 +0000 Subject: # BUILD : 1.7.14 (1103) # BUGS : 557 # NOTES : Fixed very nasty typecast. GCC Hardened should now work. git-svn-id: svn://svn.anope.org/anope/trunk@1103 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@827 5417fbe8-f217-4b02-8779-1006273d7864 --- src/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index a5d18059b..6359cedec 100644 --- a/src/main.c +++ b/src/main.c @@ -557,6 +557,7 @@ int main(int ac, char **av, char **envp) while (!quitting) { time_t t = time(NULL); + char *sgetbuf = NULL; if (debug >= 2) alog("debug: Top of main loop"); @@ -598,11 +599,13 @@ int main(int ac, char **av, char **envp) } waiting = 1; - i = (int) (long) sgets2(inbuf, sizeof(inbuf), servsock); + /* fixing this nasty, nasty typecast. why should we typecast + a char pointer to a long int? -Certus */ + sgetbuf = sgets2(inbuf, sizeof(inbuf), servsock); waiting = 0; - if (i > 0) { + if (sgetbuf) { process(); - } else if (i == 0) { + } else { int errno_save = errno; quitmsg = scalloc(BUFSIZE, 1); if (quitmsg) { -- cgit