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





------- Additional Comments From [EMAIL PROTECTED]  2004-07-27 10:19 -------
Subject: Re:  Occasionally seeing "PSPAMD" returned by spamd

On Tue, Jul 27, 2004 at 06:40:23AM -0700, [EMAIL PROTECTED] wrote:
> bytesread <= 0 does not return true when bytesread is -1 and bytesread is type
> size_t.  at least on my compiler it doesnt.  
> 
> gcc version 2.96

hrm.  On the five platforms I've tried (2 Linux and 3 Solaris), size_t
is a 4 byte unsigned value.  Therefore it'll never be < 0.  The:

bytesread == -1

bit actually makes, IIRC, the -1 get cast to an unsigned int first
(4294967295) which is then compared to bytesread.  Since 'bytesread=-1'
does the same casting thing, the equals works, but the less-than or
equals doesn't.

However, it looks like what sets bytesread (ssl_timeout_read or
fd_timeout_read) returns an int or ssize_t (which looks to be an int
everywhere as well), respectively.  Since bytesread is internal to that
function, I would say it should either be ssize_t or int (as you said)
instead.  Arguably, we should have checks for SPAMC_USE_SSL, and use
bytesread_ssize_t or bytesread_int to match the functions appropriately.

the fd_timeout_read read functions (read and recv) return -1 on error,
the ssl_timeout_read read function (SSL_read) returns 0 or -1, depending
on the error.





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

Reply via email to