Path: utzoo!attcan!uunet!wuarchive!emory!swrinde!ucsd!ucbvax!parc.xerox.com!janssen From: janssen@parc.xerox.com (Bill Janssen) Newsgroups: comp.soft-sys.andrew Subject: copying strings ; standard utility libraries Message-ID: Date: 5 Sep 90 22:41:06 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 31 I've found a particular library routine very useful, and I'm wondering 1) if it is in some Andrew library already 2) if it were to be added to some site-specific library -- just what the procedure should be for site-specific utility subroutines. Here's the routines I'd like to have as "standard" utility routines: char *copyString (s) char *s; { char *new; if (s == NULL) return(NULL); new = (char *) malloc (strlen(s) + 1); strcpy (new, s); return (new); } void freeString (s) char *s; { if (s != NULL) free(s); } freeString, of course, would be better done as a macro. Bill