[dovecot-cvs] dovecot/src/lib-index mail-index-update.c,1.42,1.43

cras at procontrol.fi cras at procontrol.fi
Sat Jan 4 19:26:32 EET 2003


Update of /home/cvs/dovecot/src/lib-index
In directory danu:/tmp/cvs-serv386/lib-index

Modified Files:
	mail-index-update.c 
Log Message:
Use unsigned char* when accessing non-NUL terminating strings. Compiler
warnings would then notify about accidentally passing them to functions which
require them NUL-terminated. Changed a few functions to use void* to avoid
unneeded casting.



Index: mail-index-update.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-update.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- mail-index-update.c	3 Jan 2003 15:57:12 -0000	1.42
+++ mail-index-update.c	4 Jan 2003 17:26:30 -0000	1.43
@@ -372,8 +372,8 @@
 } HeaderUpdateContext;
 
 static void update_header_func(MessagePart *part,
-			       const char *name, size_t name_len,
-			       const char *value, size_t value_len,
+			       const unsigned char *name, size_t name_len,
+			       const unsigned char *value, size_t value_len,
 			       void *context)
 {
 	HeaderUpdateContext *ctx = context;
@@ -387,12 +387,8 @@
 			ctx->envelope_pool =
 				pool_alloconly_create("index envelope", 2048);
 		}
-		t_push();
-		imap_envelope_parse_header(ctx->envelope_pool,
-					   &ctx->envelope,
-					   t_strndup(name, name_len),
-					   value, value_len);
-		t_pop();
+		imap_envelope_parse_header(ctx->envelope_pool, &ctx->envelope,
+					   name, name_len, value, value_len);
 	}
 
 	if (ctx->header_func != NULL) {




More information about the dovecot-cvs mailing list