Explorar o código

Return xmlChar (unsigned char) as char

The libxml2 library has a type xmlChar. It's a typedef'ed unsigned char.
I don't know why libxml2 use unsigned char * for strings instead of
char *. Return converted xmlChar as (char *).
Serj Kalichev %!s(int64=12) %!d(string=hai) anos
pai
achega
c44303616f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      clish/shell/shell_libxml2.c

+ 1 - 1
clish/shell/shell_libxml2.c

@@ -166,7 +166,7 @@ char *clish_xmlnode_fetch_attr(clish_xmlnode_t *node,
 		while (a) {
 			if (strcmp((char*)a->name, attrname) == 0) {
 				if (a->children && a->children->content)
-					return a->children->content;
+					return (char *)a->children->content;
 				else
 					return NULL;
 			}