realloc() (was: Re: Safe coding practices)
Phong Vo[drew]
kpv at ulysses.att.com
Sun Feb 10 07:26:07 AEST 1991
In article <1991Feb9.032853.25461 at unhd.unh.edu>, pas at unhd.unh.edu (Paul A. Sand) writes:
:
: Since my original posting, a number of folks have pointed out that some
: older realloc()'s indeed do trash the original block on failure. My
: own research (read: "a few minutes browsing at the bookstores") bears
: this out. One text claims that the UNIX System V Release 4 realloc()
: acts like that. (Can that be true?)
:
SysVr4 realloc is not old (at least in terms of publically available software)
and as far as I know it does not trash space after failure. The available version
may not be completely ansi-conformant with respect to realloc(NULL,size)
and free(NULL) but it should otherwise work as expected. My own version
is conformant and has few more bells and whistles but its public availability
will take time.
More information about the Comp.lang.c
mailing list