diff libpurple/protocols/null/nullprpl.c @ 31906:e8d4755ef84b

Don't use strlen() when you're just checking whether a string is empty
author Mark Doliner <mark@kingant.net>
date Mon, 22 Aug 2011 02:11:36 +0000
parents 323876c34a96
children 1d8d8649f015 3828a61c44da
line wrap: on
line diff
--- a/libpurple/protocols/null/nullprpl.c	Mon Aug 22 02:07:41 2011 +0000
+++ b/libpurple/protocols/null/nullprpl.c	Mon Aug 22 02:11:36 2011 +0000
@@ -781,10 +781,10 @@
   to_username = args[0];
   message = args[1];
 
-  if (!to_username || strlen(to_username) == 0) {
+  if (!to_username || !*to_username) {
     *error = g_strdup(_("Whisper is missing recipient."));
     return PURPLE_CMD_RET_FAILED;
-  } else if (!message || strlen(message) == 0) {
+  } else if (!message || !*message) {
     *error = g_strdup(_("Whisper is missing message."));
     return PURPLE_CMD_RET_FAILED;
   }