[PATCH] static const field reassigned in pop3.c



Cheers all,

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.

-Kacper
? auto
? libbalsa/imap/.swp
? libbalsa/imap/pop3.o.87pk7p
Index: libbalsa/imap/pop3.c
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/imap/pop3.c,v
retrieving revision 1.15
diff -b -u -d -r1.15 pop3.c
--- libbalsa/imap/pop3.c	22 Nov 2004 20:49:08 -0000	1.15
+++ libbalsa/imap/pop3.c	21 Feb 2005 00:41:16 -0000
@@ -468,7 +468,7 @@
 pop_connect(PopHandle *pop, const char *host, GError **err)
 {
   static const int SIO_BUFSZ=8192;
-  static const char *service = "pop3";
+  char *service = "pop3";
   char line[POP_LINE_LEN];
 
 #ifdef USE_TLS

Attachment: pgpWNwmT797mc.pgp
Description: PGP signature



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