summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 6359cedec..aee7a0520 100644
--- a/src/main.c
+++ b/src/main.c
@@ -557,7 +557,6 @@ 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");
@@ -599,13 +598,13 @@ int main(int ac, char **av, char **envp)
}
waiting = 1;
- /* fixing this nasty, nasty typecast. why should we typecast
- a char pointer to a long int? -Certus */
- sgetbuf = sgets2(inbuf, sizeof(inbuf), servsock);
+ /* this is a nasty nasty typecast. we need to rewrite the
+ socket stuff -Certus */
+ i = (int) (long) sgets2(inbuf, sizeof(inbuf), servsock);
waiting = 0;
- if (sgetbuf) {
+ if ((i>0) || (i<(-1))) {
process();
- } else {
+ } else if (i == 0) {
int errno_save = errno;
quitmsg = scalloc(BUFSIZE, 1);
if (quitmsg) {