libxml C fun

Neven Has haski at sezampro.yu
Mon Dec 2 11:43:51 PST 2002


On Mon, Dec 02, 2002 at 04:30:35PM +0000, Mark Ellis wrote:
> > >          profile_len = strlen(xml)+1;
> > 
> > That +1, is that neccessary when you're getting the strlen()?  That
> > looks like an edge condition.
> 
> I wasnt sure whether xmlParseMemory wanted the length of the string 
> with or without the terminating NULL, hence the +1, though it doesnt 
> work without it either.

Docs say "the size of the array", which does include '\0'.

But it doesn't matter (just looked at the code), as libxml's buffer,
created for parsing, puts '\0' itself, after "size" characters.


Neven

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list