delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/19/14:02:41

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: thing1-200.fsi.com: ford owned process doing -bs
Date: Thu, 19 Feb 2004 13:02:21 -0600 (CST)
From: Brian Ford <ford AT vss DOT fsi DOT com>
X-X-Sender: ford AT thing1-200
Reply-To: cygwin AT cygwin DOT com
To: Thomas Mellman <tmellman AT yahoo DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: ftp bug report
In-Reply-To: <20040219185629.75069.qmail@web14302.mail.yahoo.com>
Message-ID: <Pine.GSO.4.58.0402191259350.23862@thing1-200>
References: <20040219185629 DOT 75069 DOT qmail AT web14302 DOT mail DOT yahoo DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019