Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ncar!boulder!sunybcs!rutgers!bellcore!faline!thumper!ulysses!att!ihlpb!nevin1 From: nevin1@ihlpb.ATT.COM (Liber) Newsgroups: comp.lang.c Subject: Re: Strcpy fun w/ Ultrix Message-ID: <10401@ihlpb.ATT.COM> Date: 3 May 89 00:33:17 GMT References: Reply-To: nevin1@ihlpb.UUCP (55528-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 20 In article bobg+@andrew.cmu.edu (Robert Steven Glickstein) writes: |> Excerpts from ext.nn.comp.lang.c: 27-Apr-89 Strcpy fun w/ Ultrix tim@scsmo1.UUCP (618) |> strcpy(x->name=malloc(strlen(in)+1),in); |Bad programming style alert! |Do you WANT to dump core if malloc returns NULL? Sometimes this leads to a better chance of recovery than some of the other ways I've seen programs handle this situation (such as not being able to do anything at all, for instance). All things considered, I would rather have a graceful recovery. Oh, well. -- _ __ NEVIN ":-)" LIBER nevin1@ihlpb.ATT.COM (312) 979-4751 IH 4F-410 ' ) ) "I will not be pushed, filed, stamped, indexed, / / _ , __o ____ briefed, debriefed or numbered! My life is my own!" / (_