[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Follow-up: Re: Too many tokens?




Check posix guide, realloc() is defined by the standard.

Also, you can add a realloc wrapper as with malloc() and free(), just in case.

--Kervin


John Morrissey wrote:
On Sun, Apr 28, 2002 at 12:27:58PM -0400, Kervin L. Pierre wrote:
% I am curious as to why you did not use realloc().

The glibc and Solaris man pages indicate that the contents of a buffer
passed to realloc() remain unchanged up until the lesser of the two sizes,
but I wasn't sure if that was a 100% portable assumption and I wanted to be
safe. If it is portable, my life becomes a whole lot easier because I can
just realloc() as necessary.

john