diff mcabber/mcabber/xmpp_iqrequest.c @ 1899:decf94827efe

More lm_message_node_get_child_value() return value checks
author Mikael Berthe <mikael@lilotux.net>
date Mon, 12 Apr 2010 23:40:14 +0200
parents e6d355e50d7a
children e6beab22099b
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_iqrequest.c	Mon Apr 12 23:24:20 2010 +0200
+++ b/mcabber/mcabber/xmpp_iqrequest.c	Mon Apr 12 23:40:14 2010 +0200
@@ -241,21 +241,21 @@
 
   // Get result data...
   p = lm_message_node_get_child_value(ansqry, "name");
-  if (p) {
+  if (p && *p) {
     buf = g_strdup_printf("Name:    %s", p);
     scr_WriteIncomingMessage(bjid, buf,
                              0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0);
     g_free(buf);
   }
   p = lm_message_node_get_child_value(ansqry, "version");
-  if (p) {
+  if (p && *p) {
     buf = g_strdup_printf("Version: %s", p);
     scr_WriteIncomingMessage(bjid, buf,
                              0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0);
     g_free(buf);
   }
   p = lm_message_node_get_child_value(ansqry, "os");
-  if (p) {
+  if (p && *p) {
     buf = g_strdup_printf("OS:      %s", p);
     scr_WriteIncomingMessage(bjid, buf,
                              0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0);
@@ -306,21 +306,21 @@
 
   // Get result data...
   p = lm_message_node_get_child_value(ansqry, "utc");
-  if (p) {
+  if (p && *p) {
     buf = g_strdup_printf("UTC:  %s", p);
     scr_WriteIncomingMessage(bjid, buf,
                              0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0);
     g_free(buf);
   }
   p = lm_message_node_get_child_value(ansqry, "tz");
-  if (p) {
+  if (p && *p) {
     buf = g_strdup_printf("TZ:   %s", p);
     scr_WriteIncomingMessage(bjid, buf,
                              0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0);
     g_free(buf);
   }
   p = lm_message_node_get_child_value(ansqry, "display");
-  if (p) {
+  if (p && *p) {
     buf = g_strdup_printf("Time: %s", p);
     scr_WriteIncomingMessage(bjid, buf,
                              0, HBB_PREFIX_INFO | HBB_PREFIX_CONT, 0);
@@ -406,7 +406,7 @@
 {
   char *buf;
 
-  if (!text || !bjid || !label)
+  if (!text || !*text || !bjid || !label)
     return;
 
   buf = g_strdup_printf("%s: %s%s%s%s%s%s%s%s%s%s", label,