diff options
author | certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-08-02 10:07:36 +0000 |
---|---|---|
committer | certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-08-02 10:07:36 +0000 |
commit | af56eb8e61d948b0b10793fae29461f6eed805c7 (patch) | |
tree | 4e3cd8cd2ddda38a68bf98eb7498bad68316463b /src | |
parent | 147d9a91a69a57f12bc35b059d891ea9e6068689 (diff) |
# 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
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
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) { |