From d0752e8b08d37395fd036046552fa6b4fb92ac17 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 22 Sep 2012 13:12:12 +0100 Subject: Little cleanup. Use xt_from_string() where possible. --- lib/xmltree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/xmltree.c') 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 ); -- cgit v1.2.3