Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!bionet!csd4.milw.wisc.edu!leah!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!andrew.cmu.edu!bobg+ From: bobg+@andrew.cmu.edu (Robert Steven Glickstein) Newsgroups: comp.lang.c Subject: Re: Strcpy fun w/ Ultrix Message-ID: Date: 1 May 89 21:22:28 GMT Organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA Lines: 15 > Excerpts from ext.nn.comp.lang.c: 27-Apr-89 Strcpy fun w/ Ultrix > tim@scsmo1.UUCP (618) > I ran accross a problem with strcpy in ultrix, for some reason it will > not return its first argument. This is something like the "buged" code: > x->name=strcpy(malloc(strlen(in)+1),in); > The solution was: > strcpy(x->name=malloc(strlen(in)+1),in); Danger, Will Robinson! Bad programming style alert! Do you WANT to dump core if malloc returns NULL? -Bob Glickstein