Hello list

I am trying write a sax parser reading from a unix socket. I wrote a
derived class from BinImputStream and I rewrote curPos() and
readBytes() members.
All right, but

MY_InputStream::readBytes(          XMLByte* const  toFill
                               , const unsigned int    maxToRead)
{
 int  Result;

 int t=recv(fSource, x, maxToRead, 0);

 if(t<=0)
   t=0;

 for(Result=0;Result<t;Result++)
   toFill[Result]=x[Result];

 return(t);
}

If x is a local buffer

MY_InputStream::readBytes(          XMLByte* const  toFill
                               , const unsigned int    maxToRead)
{
char x[1000];

or directly toFill

 int t=recv(fSource, toFill, maxToRead, 0);


there are not problems but if x is a private member of MY_InputStream,

class  MY_InputStream : public BinInputStream
{
private :
   char x[1000];


I get a runtime error.

*** glibc detected *** free(): invalid next size (fast): 0x0805b0d0 ***



Thanks in avance.




--
José Luis Zabalza
jlz.3008 a t  gmail.com
Linux Counter 172551

Reply via email to