Xref: utzoo comp.std.c:949 comp.lang.c:17278 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ncis.llnl.gov!lll-winken!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.std.c,comp.lang.c Subject: Re: realloc Summary: Required by ANSI Keywords: realloc NULL Message-ID: <681@sdrc.UUCP> Date: 29 Mar 89 22:02:25 GMT References: <10170@bloom-beacon.MIT.EDU> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 17 In article <10170@bloom-beacon.MIT.EDU>, scs@adam.pika.mit.edu (Steve Summit) writes: > Today, for the third time in half as many years, I got badly > burned, and wasted lots of time, due to a bug in a certain > vendor's implementation of realloc. It is an apparently well- > kept secret that realloc is supposed to behave gracefully at > a slightly special-cased boundary point: when handed a NULL > pointer and a nonzero size, it acts essentially as a malloc. And when handed a non-NULL pointer and a zero size, it acts like free. This behavior is required by the draft ANSI Standard. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@sdrc.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150 AT&T: (513) 576-2070 "When all else fails, read the directions."