Conor Daly wrote:
>> On Wed, Jul 04, 2001 at 10:16:47AM +0100 or so it is rumoured hereabouts,
> Dave Neary thought:
> > Conor Daly wrote:
> > >
> > > > if (my_buf)
> > > > {
> > > > char *tmp = realloc(my_buf, strlen(my_buf) +
> > > > strlen(next_string) + 1);
>> The only question left here is:
>> Does 'tmp = realloc(my_buf,<size>);' free the block pointed to by my_buf
> while returning the address of the new block into tmp?
Yes, if the call succeeds. That's he point of realloc. If the call
fails, my_buf is unmodified.
Cheers,
Dave.
--
David Neary, E-Mail dave.neary at palamon.ie
Palamon Technologies Ltd. Phone +353-1-634-5059
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!