[Expat-discuss] Cannot parse simple xml

Golibasku ceo at absoft-net.com
Thu Aug 12 03:43:06 CEST 2004


Yes, it is the buffer size problem.
Thank you. :-)

----- Original Message ----- 
To: <expat-discuss at libexpat.org>
Sent: Thursday, August 12, 2004 2:10 AM
Subject: Re: [Expat-discuss] Cannot parse simple xml


> > Hello,
> >     I try to parse the following document. But it always tell me "not
> > well-formed (invalid token) at line 1". What is the reason ??
> > 
> 
> >  CHAR buf[100];
> >  strcpy(buf, "<?xml version=\"1.0\"?> <note> <to> Tove </to> <from>
> >  Jani
> > </from> <heading> Reminder </heading> <body> Don't forget me this
> > weekend </body> </note>");
> 
> Looks to me like your buffer is too small.  Your XML doc is over 100 
> chars long, so it's just luck the you haven't smashed the stack with 
> that strcpy.  
> 
> Try increasing the size of your buffer and seeing what happens.



More information about the Expat-discuss mailing list