sorry about this mess....strlen/sizeof....I was blind
-----Original Message----- From: Daniel Veillard <[EMAIL PROTECTED]> To: Espen Ekeroth <[EMAIL PROTECTED]> Date: Fri, 11 Mar 2005 05:22:07 -0500 Subject: Re: [xml] xmlReadMemory limitation > On Fri, Mar 11, 2005 at 11:12:30AM +0100, Espen Ekeroth wrote: > > 64 doc = xmlReadMemory(a_node->content, sizeof(a_node- > > >content), "noname.xml", NULL, 0); > > [...] > > The reason for this error is that xmlReadMemory only sees 4 bytes as > the > > size due to the return value from sizeof(a_node->content) > > what about reading my mail ;-) ? > > : doc = xmlReadMemory(a_node->content, strlen(a_node->content), > : "noname.xml", NULL, 0); > > obviously sizeof of a pointer is 4 on an i386 architecture. I asked to > use strlen(), which walks the memory pointed until it find the 0 byte > indicating the end and returns the length. It really is basic C > knowledge. > > Daniel > > -- > Daniel Veillard | Red Hat Desktop team http://redhat.com/ > [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit > http://xmlsoft.org/ > http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ > > _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
