aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/xmltree.c7
-rw-r--r--lib/xmltree.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/xmltree.c b/lib/xmltree.c
index 74292be9..91d256d2 100644
--- a/lib/xmltree.c
+++ b/lib/xmltree.c
@@ -262,13 +262,16 @@ void xt_cleanup( struct xt_parser *xt, struct xt_node *node, int depth )
}
}
-struct xt_node *xt_from_string( const char *in )
+struct xt_node *xt_from_string( const char *in, int len )
{
struct xt_parser *parser;
struct xt_node *ret;
+ if( len == 0 )
+ len = strlen( in );
+
parser = xt_new( NULL, NULL );
- xt_feed( parser, in, strlen( in ) );
+ xt_feed( parser, in, len );
ret = parser->root;
parser->root = NULL;
xt_free( parser );
diff --git a/lib/xmltree.h b/lib/xmltree.h
index 5a0dbc8e..ac77fada 100644
--- a/lib/xmltree.h
+++ b/lib/xmltree.h
@@ -81,7 +81,7 @@ void xt_reset( struct xt_parser *xt );
int xt_feed( struct xt_parser *xt, const char *text, int text_len );
int xt_handle( struct xt_parser *xt, struct xt_node *node, int depth );
void xt_cleanup( struct xt_parser *xt, struct xt_node *node, int depth );
-struct xt_node *xt_from_string( const char *in );
+struct xt_node *xt_from_string( const char *in, int text_len );
char *xt_to_string( struct xt_node *node );
void xt_print( struct xt_node *node );
struct xt_node *xt_dup( struct xt_node *node );