diff libpurple/protocols/oscar/family_feedbag.c @ 31905:323876c34a96

Don't use strlen() when all you're trying to do is check if the string is empty
author Mark Doliner <mark@kingant.net>
date Mon, 22 Aug 2011 02:07:41 +0000
parents 142429bcb4c8
children f75041cb3fec 3828a61c44da
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_feedbag.c	Mon Aug 22 01:53:37 2011 +0000
+++ b/libpurple/protocols/oscar/family_feedbag.c	Mon Aug 22 02:07:41 2011 +0000
@@ -990,7 +990,7 @@
 		return -EINVAL;
 
 	/* Either add or remove the 0x0131 TLV from the TLV chain */
-	if ((alias != NULL) && (strlen(alias) > 0))
+	if (alias && *alias)
 		aim_tlvlist_replace_str(&tmp->data, 0x0131, alias);
 	else
 		aim_tlvlist_remove(&tmp->data, 0x0131);
@@ -1020,7 +1020,7 @@
 		return -EINVAL;
 
 	/* Either add or remove the 0x0131 TLV from the TLV chain */
-	if ((comment != NULL) && (strlen(comment) > 0))
+	if (comment && *comment)
 		aim_tlvlist_replace_str(&tmp->data, 0x013c, comment);
 	else
 		aim_tlvlist_remove(&tmp->data, 0x013c);