changeset 16536:1c07ce257fd7

Fix the g_return_if_fail() guards that prevent setting more than one data source. We want the data sources to be NULL, because the one we're setting needs to be the only one set.
author Richard Laager <rlaager@wiktel.com>
date Fri, 27 Apr 2007 18:56:41 +0000
parents 1d3d54e964ce
children 42362f23d5a8 7bd696193402
files libpurple/protocols/msn/slpmsg.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slpmsg.c	Fri Apr 27 18:17:09 2007 +0000
+++ b/libpurple/protocols/msn/slpmsg.c	Fri Apr 27 18:56:41 2007 +0000
@@ -106,9 +106,9 @@
 						 long long size)
 {
 	/* We can only have one data source at a time. */
-	g_return_if_fail(slpmsg->buffer);
-	g_return_if_fail(slpmsg->img);
-	g_return_if_fail(slpmsg->fp);
+	g_return_if_fail(slpmsg->buffer == NULL);
+	g_return_if_fail(slpmsg->img == NULL);
+	g_return_if_fail(slpmsg->fp == NULL);
 
 	if (body != NULL)
 		slpmsg->buffer = g_memdup(body, size);
@@ -122,9 +122,9 @@
 msn_slpmsg_set_image(MsnSlpMessage *slpmsg, PurpleStoredImage *img)
 {
 	/* We can only have one data source at a time. */
-	g_return_if_fail(slpmsg->buffer);
-	g_return_if_fail(slpmsg->img);
-	g_return_if_fail(slpmsg->fp);
+	g_return_if_fail(slpmsg->buffer == NULL);
+	g_return_if_fail(slpmsg->img == NULL);
+	g_return_if_fail(slpmsg->fp == NULL);
 
 	slpmsg->img = purple_imgstore_ref(img);
 	slpmsg->buffer = (guchar *)purple_imgstore_get_data(img);
@@ -137,9 +137,9 @@
 	struct stat st;
 
 	/* We can only have one data source at a time. */
-	g_return_if_fail(slpmsg->buffer);
-	g_return_if_fail(slpmsg->img);
-	g_return_if_fail(slpmsg->fp);
+	g_return_if_fail(slpmsg->buffer == NULL);
+	g_return_if_fail(slpmsg->img == NULL);
+	g_return_if_fail(slpmsg->fp == NULL);
 
 	slpmsg->fp = g_fopen(file_name, "rb");