Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!uwvax!rutgers!att!occrsh!occrsh.ATT.COM!scsmo1.UUCP!tim From: tim@scsmo1.UUCP Newsgroups: comp.lang.c Subject: Strcpy fun w/ Ultrix Message-ID: <9300002@scsmo1.UUCP> Date: 27 Apr 89 15:32:00 GMT Lines: 15 Nf-ID: #N:scsmo1.UUCP:9300002:000:617 Nf-From: scsmo1.UUCP!tim Apr 27 09:32:00 1989 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); I was under the impression that strcpy will copy its first argument and it does most of the time. I have never run into this problem before, is it common? The thing that strcpy was returing was in a different section of prevously malloc'ed memory and the strings do not overlap. tim hogard uunet!worlds!gensis!hogard /* new address */ "Ultrix will drive you to drink!"