http://bugzilla.spamassassin.org/show_bug.cgi?id=3506





------- Additional Comments From [EMAIL PROTECTED]  2004-07-27 06:38 -------
        libspamc_log(flags, LOG_ERR, "bytesread is %d", bytesread);
        if (bytesread <= 0) {
        libspamc_log(flags, LOG_ERR, "call goto failure");
            failureval = EX_IOERR;
            goto failure;
        }

produces

Jul 27 08:00:05 dev spamc[17254]: bytesread is -1
Jul 27 08:00:06 dev spamc[17254]: bytesread is -1
Jul 27 08:00:07 dev spamc[17254]: bytesread is 1
Jul 27 08:00:07 dev last message repeated 17 times
Jul 27 08:00:07 dev spamc[17254]: spamd responded with bad string 'PRSPAMD/1.1 
0 EX_OK'


        libspamc_log(flags, LOG_ERR, "bytesread is %d", bytesread);
        if (bytesread == -1) {
        libspamc_log(flags, LOG_ERR, "call goto failure");
            failureval = EX_IOERR;
            goto failure;
        }

Jul 27 08:01:09 dev spamc[17733]: bytesread is -1
Jul 27 08:01:09 dev spamc[17733]: call goto failure

so it looks like goto failure was never being called, and therefore the for 
loop continues on... that is why i did it the way i did.   maybe you cannot 
reproduce because your compiler make a proper comparision of size_t types for 
bytesread <= 0  and mine doesnt??   using  int bytesread, i can compare 
bytesread <= 0 just fine.

So there are two options, change bytesread to an int, or change it to bytesread 
== -1.  or 


--- libspamc.c  (revision 30781)
+++ libspamc.c  (working copy)
@@ -648,7 +648,7 @@
                      char *buf, size_t *lenp, size_t bufsiz)
 {
     int failureval;
-    size_t bytesread = 0;
+    int bytesread = 0;
     size_t len;

     UNUSED_VARIABLE(m);
@@ -673,6 +673,7 @@
        }

        if (bytesread <= 0) {
+            libspamc_log(flags, LOG_ERR, "goto failure because bytesread is %
d", bytesread);
            failureval = EX_IOERR;
            goto failure;
        }


Jul 27 08:33:39 dev spamc[31229]: goto failure because bytesread is -1



--- libspamc.c  (revision 30781)
+++ libspamc.c  (working copy)
@@ -672,7 +672,8 @@
            return EX_OK;
        }

-       if (bytesread <= 0) {
+       if (bytesread == -1) {
+            libspamc_log(flags, LOG_ERR, "goto failure because bytesread is %
d", bytesread);
            failureval = EX_IOERR;
            goto failure;



Jul 27 08:34:57 dev spamc[31780]: goto failure because bytesread is -1


d



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to