This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: ftp bug report
- From: Brian Ford <ford at vss dot fsi dot com>
- To: Thomas Mellman <tmellman at yahoo dot com>
- Cc: cygwin at cygwin dot com
- Date: Thu, 19 Feb 2004 13:02:21 -0600 (CST)
- Subject: Re: ftp bug report
- References: <20040219185629.75069.qmail@web14302.mail.yahoo.com>
- Reply-to: cygwin at cygwin dot com
On Thu, 19 Feb 2004, Thomas Mellman wrote:
> Corinna Vinschen wrote:
>
> >As an exercise for the reader:
> >
> > buf = (char *) malloc (size);
> > to = buf;
> > [...]
> > if (newsize > size)
> > buf = realloc (buf, newsize);
> > while (newsize--)
> > *to++ = *src++;
> >
> >What's wrong with this picture?
> >
>
> Oh, I hope there's an answer section in the back
> of the book.
>
Hint: realloc can move the data, returning a different base address.
--
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax: 314-551-8444
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/