diff libpurple/protocols/oscar/flap_connection.c @ 30826:bbb27d65681f

Bstream cleanups: 1. g_return_val_if_fail()'s in place of XXX's. 2. byte_stream_empty() -> byte_stream_bytes_left(). I think the world is a better place now.
author ivan.komarov@soc.pidgin.im
date Wed, 28 Jul 2010 23:53:25 +0000
parents 553cd883a29a
children 11c54d781835
line wrap: on
line diff
--- a/libpurple/protocols/oscar/flap_connection.c	Wed Jul 28 23:13:25 2010 +0000
+++ b/libpurple/protocols/oscar/flap_connection.c	Wed Jul 28 23:53:25 2010 +0000
@@ -733,7 +733,7 @@
 	aim_module_t *cur;
 	aim_modsnac_t snac;
 
-	if (byte_stream_empty(&frame->data) < 10)
+	if (byte_stream_bytes_left(&frame->data) < 10)
 		return;
 
 	snac.family = byte_stream_get16(&frame->data);
@@ -800,7 +800,7 @@
 	GSList *tlvlist;
 	char *msg = NULL;
 
-	if (byte_stream_empty(&frame->data) == 0) {
+	if (byte_stream_bytes_left(&frame->data) == 0) {
 		/* XXX should do something with this */
 		return;
 	}
@@ -1062,8 +1062,8 @@
 		return;
 
 	/* Make sure we don't send past the end of the bs */
-	if (count > byte_stream_empty(bs))
-		count = byte_stream_empty(bs); /* truncate to remaining space */
+	if (count > byte_stream_bytes_left(bs))
+		count = byte_stream_bytes_left(bs); /* truncate to remaining space */
 
 	if (count == 0)
 		return;