Re: [PATCH] static const field reassigned in pop3.c



On 02/20/05 20:55:45, Peter Bloomfield wrote:
On 02/20/2005 07:56:38 PM, Kacper Wysocki wrote:
ever since the pop3s fix I've had trouble connecting to my non-ssl pop3 accounts. I finally got around to debugging it.

After a bit of figuring out, I discovered that my compiler (gcc 3.3.5) doesn't reinitialize static fields on subsequent calls. Not sure if that's ANSI C, didn't check. Either way, char *service should probably not be a static const.

Attached one-liner patch fixes the problem.

It certainly shouldn't be static--but it should probably still be const--committed as such--thanks for debugging that!

I thought const fields indicated that the field wouldn't be reassinged? Or do you use 'const' here to mean that it's a pointer to a character constant?

0K
--
No need to cc: me, I'm on the list.
Get my GnuPG public key from pgp.mit.edu.
Signed mail preferred. Please encrypt where appropriate.

Attachment: pgp5ZPJ38qWuU.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]