File:  [MW Coherent from dump] / coherent / b / lib / libc / string / strdup.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * libc/string/strdup.c
 * Not in ANSI draft standard.
 * Return a malloc()'ed copy of a string.
 */

#include <stddef.h>
#include <stdlib.h>
#include <string.h>

char *
strdup(s) register char *s;
{
	register char *cp;

	return ((cp = malloc(strlen(s) + 1)) == NULL) ? cp : strcpy(cp, s);
}

/* end of strdup.c */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.