changeset 16541:b33f5b606573

merge of '3470d9c0747eae8c926e33748f29f946efd419b0' and 'cf51292b9bf12554eecb319a673f153ef5c6f0e4'
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 27 Apr 2007 21:51:39 +0000
parents 5382c414aab1 (current diff) 42362f23d5a8 (diff)
children e96a4756734a
files PROGRAMMING_NOTES
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/buddyicon.c	Fri Apr 27 21:31:57 2007 +0000
+++ b/libpurple/buddyicon.c	Fri Apr 27 21:51:39 2007 +0000
@@ -98,6 +98,7 @@
 {
 	PurpleCipherContext *context;
 	gchar digest[41];
+	const char *ext;
 
 	context = purple_cipher_context_new_by_name("sha1", NULL);
 	if (context == NULL)
@@ -115,9 +116,10 @@
 	}
 	purple_cipher_context_destroy(context);
 
+	ext = purple_util_get_image_extension(icon_data, icon_len);
+
 	/* Return the filename */
-	return g_strdup_printf("%s.%s", digest,
-	                       purple_util_get_image_extension(icon_data, icon_len));
+	return g_strdup_printf("%s%s%s", digest, ext ? "." : "", ext ? ext : "");
 }
 
 static void