Strcpy fun w/ Ultrix

Robert J Woodhead trebor at biar.UUCP
Sat Apr 29 15:37:45 AEST 1989


In article <9300002 at scsmo1.UUCP> tim at scsmo1.UUCP writes:
>The solution was:
>strcpy(x->name=malloc(strlen(in)+1),in);

Er, does Ultrix have _strdup_?  You could just say:

	x->name=strdup(in);

-- 
Robert J Woodhead, Biar Games, Inc.  ...!uunet!biar!trebor | trebor at biar.UUCP
"The NY Times is read by the people who run the country.  The Washington Post
is read by the people who think they run the country.   The National Enquirer
is read by the people who think Elvis is alive and running the country..."



More information about the Comp.lang.c mailing list