src/protocols/msn/msnobject.c

changeset 6790
e2f227d48b62
parent 6789
a1f3aa200bf8
child 7933
a59beea5a510
--- a/src/protocols/msn/msnobject.c	Sun Sep 07 23:58:43 2003 +0000
+++ b/src/protocols/msn/msnobject.c	Mon Sep 08 01:47:58 2003 +0000
@@ -26,7 +26,7 @@
 	{ \
 		tag += strlen(id "=\""); \
 		c = strchr(tag, '"'); \
-		obj->field = g_strndup(tag, tag - c); \
+		obj->field = g_strndup(tag, c - tag); \
 	}
 
 #define GET_INT_TAG(field, id) \
@@ -35,7 +35,7 @@
 		char buf[16]; \
 		tag += strlen(id "=\""); \
 		c = strchr(tag, '"'); \
-		strncpy(buf, tag, tag - c); \
+		strncpy(buf, tag, c - tag); \
 		obj->field = atoi(buf); \
 	}
 
@@ -63,8 +63,6 @@
 
 	obj = msn_object_new();
 
-	g_return_val_if_fail(str != NULL, NULL);
-
 	GET_STRING_TAG(creator,  "Creator");
 	GET_INT_TAG(size,        "Size");
 	GET_INT_TAG(type,        "Type");

mercurial