[dovecot-cvs] dovecot/src/lib-imap imap-bodystructure.c, 1.51, 1.52 imap-parser.h, 1.19, 1.20

cras at dovecot.org cras at dovecot.org
Sun Sep 11 16:23:03 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-imap
In directory talvi:/tmp/cvs-serv16438/lib-imap

Modified Files:
	imap-bodystructure.c imap-parser.h 
Log Message:
Compiler warning fixes



Index: imap-bodystructure.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-bodystructure.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- imap-bodystructure.c	11 Sep 2005 13:19:26 -0000	1.51
+++ imap-bodystructure.c	11 Sep 2005 13:23:01 -0000	1.52
@@ -591,9 +591,10 @@
 	if (!str_append_imap_arg(str, &args[1]))
 		return FALSE;
 
-	text = strcasecmp(IMAP_ARG_STR(&args[0]), "text") == 0;
-	message_rfc822 = strcasecmp(IMAP_ARG_STR(&args[0]), "message") == 0 &&
-		strcasecmp(IMAP_ARG_STR(&args[1]), "rfc822") == 0;
+	text = strcasecmp(IMAP_ARG_STR_NONULL(&args[0]), "text") == 0;
+	message_rfc822 =
+		strcasecmp(IMAP_ARG_STR_NONULL(&args[0]), "message") == 0 &&
+		strcasecmp(IMAP_ARG_STR_NONULL(&args[1]), "rfc822") == 0;
 
 	args += 2;
 

Index: imap-parser.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-parser.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- imap-parser.h	7 Aug 2005 11:41:21 -0000	1.19
+++ imap-parser.h	11 Sep 2005 13:23:01 -0000	1.20
@@ -53,6 +53,11 @@
 	 (arg)->type == IMAP_ARG_LITERAL ? \
 	 (arg)->_data.str : _imap_arg_str_error(arg))
 
+#define IMAP_ARG_STR_NONULL(arg) \
+	((arg)->type == IMAP_ARG_ATOM || (arg)->type == IMAP_ARG_STRING || \
+	 (arg)->type == IMAP_ARG_LITERAL ? \
+	 (arg)->_data.str : _imap_arg_str_error(arg))
+
 #define IMAP_ARG_LITERAL_SIZE(arg) \
 	(((arg)->type == IMAP_ARG_LITERAL_SIZE || \
 	 (arg)->type == IMAP_ARG_LITERAL_SIZE_NONSYNC) ? \



More information about the dovecot-cvs mailing list