Oops. Fixed a mis-use of GPtrArray. If we set_size, then using
authorJeffrey Stedfast <fejj@ximian.com>
Wed, 22 Aug 2001 17:58:44 +0000 (17:58 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Wed, 22 Aug 2001 17:58:44 +0000 (17:58 +0000)
2001-08-22  Jeffrey Stedfast  <fejj@ximian.com>

* providers/pop3/camel-pop3-folder.c (pop3_generate_uids):
Oops. Fixed a mis-use of GPtrArray. If we set_size, then using
g_ptr_array_add will assume `size' elements have already been
initialized and will start appending on to the end.

camel/ChangeLog
camel/providers/pop3/camel-pop3-folder.c

index 5eaf869..a0e6e07 100644 (file)
@@ -1,3 +1,10 @@
+2001-08-22  Jeffrey Stedfast  <fejj@ximian.com>
+
+       * providers/pop3/camel-pop3-folder.c (pop3_generate_uids):
+       Oops. Fixed a mis-use of GPtrArray. If we set_size, then using
+       g_ptr_array_add will assume `size' elements have already been
+       initialized and will start appending on to the end.
+
 2001-08-21  Jeffrey Stedfast  <fejj@ximian.com>
 
        * camel-pgp-context.c (pgp_verify): Turn on --batch and reenable
index f9f53c7..6a7a1e6 100644 (file)
@@ -163,10 +163,12 @@ pop3_generate_uids (CamelFolder *folder, int count, CamelException *ex)
                camel_object_unref (CAMEL_OBJECT (stream));
                
                uid = base64_encode_simple (digest, 16);
-               if (uid && *uid)
-                       g_ptr_array_add (uids, uid);
+               uids->pdata[i] = uid;
        }
        
+       if (i < count)
+               g_ptr_array_set_size (uids, i);
+       
        return uids;
        
  exception: