changeset 335:526ebe074df1 HEAD

message_part_serialize_update_header() was still broken, it modified the start position of header record.
author Timo Sirainen <tss@iki.fi>
date Mon, 30 Sep 2002 23:02:11 +0300
parents e34e14d758eb
children 38bb7337df0c
files src/lib-mail/message-part-serialize.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-mail/message-part-serialize.c	Mon Sep 30 02:08:18 2002 +0300
+++ b/src/lib-mail/message-part-serialize.c	Mon Sep 30 23:02:11 2002 +0300
@@ -183,8 +183,10 @@
 	spart->header_lines = hdr_size->lines;
 
 	if (pos_diff != 0) {
-		/* have to update all positions */
-		count = size / sizeof(SerializedMessagePart);
+		/* have to update all positions, but skip the first one */
+		count = (size / sizeof(SerializedMessagePart))-1;
+		spart++;
+
 		for (i = 0; i < count; i++, spart++) {
 			if (spart->physical_pos < first_pos ||
 			    spart->physical_pos >= OFF_T_MAX) {