Bläddra i källkod

XML backend: fix assertion tests

Both name and help can be NULL if the underlying XML
backend says so (i.e. it fails to find the corresponding
attribute). We shall not test the first character of the
attribute but its existence.

This patch reverts a forgotten change that comes from
the first implementation of the XML backends.
Emmanuel Deloget 12 år sedan
förälder
incheckning
9f4ba3e5f5
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      clish/shell/shell_xml.c

+ 2 - 2
clish/shell/shell_xml.c

@@ -266,7 +266,7 @@ process_command(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 	if (!allowed)
 		goto process_command_end;
 
-	assert(*name);
+	assert(name);
 
 	/* check this command doesn't already exist */
 	old = clish_view_find_command(v, name, BOOL_FALSE);
@@ -277,7 +277,7 @@ process_command(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 		goto process_command_end;
 	}
 
-	assert(*help);
+	assert(help);
 
 	/* Reference 'ref' field */
 	if (ref) {