gmime r1224 - in trunk: . gmime



Author: fejj
Date: Mon Mar 10 22:36:22 2008
New Revision: 1224
URL: http://svn.gnome.org/viewvc/gmime?rev=1224&view=rev

Log:
2008-03-10  Jeffrey Stedfast  <fejj novell com>

	* gmime/gmime-parser.c (parser_scan_mime_part_content): Don't let
	size go negative.



Modified:
   trunk/ChangeLog
   trunk/gmime/gmime-charset.c
   trunk/gmime/gmime-parser.c
   trunk/gmime/gmime-utils.c

Modified: trunk/gmime/gmime-charset.c
==============================================================================
--- trunk/gmime/gmime-charset.c	(original)
+++ trunk/gmime/gmime-charset.c	Mon Mar 10 22:36:22 2008
@@ -905,8 +905,6 @@
 void
 g_mime_set_user_charsets (const char **charsets)
 {
-	int i, n = 0;
-	
 	if (user_charsets)
 		g_strfreev (user_charsets);
 	

Modified: trunk/gmime/gmime-parser.c
==============================================================================
--- trunk/gmime/gmime-parser.c	(original)
+++ trunk/gmime/gmime-parser.c	Mon Mar 10 22:36:22 2008
@@ -1269,8 +1269,10 @@
 		/* last '\n' belongs to the boundary */
 		if (priv->persist_stream && priv->seekable)
 			end = parser_offset (priv, NULL) - crlf;
+		else if (content->len > crlf)
+			g_byte_array_set_size (content, content->len - crlf);
 		else
-			g_byte_array_set_size (content, MAX (content->len - crlf, 0));
+			g_byte_array_set_size (content, 0);
 	} else if (priv->persist_stream && priv->seekable) {
 		end = parser_offset (priv, NULL);
 	}

Modified: trunk/gmime/gmime-utils.c
==============================================================================
--- trunk/gmime/gmime-utils.c	(original)
+++ trunk/gmime/gmime-utils.c	Mon Mar 10 22:36:22 2008
@@ -1549,8 +1549,8 @@
 	const char **charsets, **user_charsets, *locale, *best;
 	size_t outleft, outlen, min, ninval;
 	unsigned int included = 0;
-	char *out, *outbuf;
 	iconv_t cd;
+	char *out;
 	int i = 0;
 	
 	g_return_val_if_fail (text != NULL, NULL);
@@ -1774,7 +1774,7 @@
 	len = declen;
 	buf = g_malloc (len + 1);
 	
-	charset_convert (cd, decoded, declen, &buf, &len, &ninval);
+	charset_convert (cd, (char *) decoded, declen, &buf, &len, &ninval);
 	
 	g_mime_iconv_close (cd);
 	
@@ -2281,7 +2281,6 @@
 rfc2047_encode_merge_rfc822_words (struct _rfc822_word **wordsp)
 {
 	struct _rfc822_word *word, *next, *words = *wordsp;
-	gboolean rfc2047_words = FALSE;
 	
 	/* first pass: merge qstrings with adjacent qstrings and encwords with adjacent encwords */
 	word = words;



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