source: trunk/src/binutils/libiberty/strdup.c@ 10

Last change on this file since 10 was 10, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 172 bytes
Line 
1char *
2strdup(s)
3 char *s;
4{
5 char *result = (char*)malloc(strlen(s) + 1);
6 if (result == (char*)0)
7 return (char*)0;
8 strcpy(result, s);
9 return result;
10}
Note: See TracBrowser for help on using the repository browser.