[BACK]Return to strdup.c CVS log [TXT][DIR] Up to [local] / src / libexec / ld.so

File: [local] / src / libexec / ld.so / Attic / strdup.c (download)

Revision 1.3, Mon Apr 2 23:11:21 2001 UTC (23 years, 2 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.2: +2 -1 lines

Cleanup for 64bit support.
Pieces by art, niklas and me.
Only tested on powerpc.

/*	$OpenBSD: strdup.c,v 1.3 2001/04/02 23:11:21 drahn Exp $	*/

#include <string.h>

void * _dl_malloc(int);

char *
_dl_strdup(const char *orig)
{
	char *newstr;
	newstr = _dl_malloc(strlen(orig)+1);
	strcpy(newstr, orig);
	return (newstr);
}