NetBSD-5.0.2/dist/bind/lib/bind/bsd/strdup.c

Compare this file to the similar file:
Show the results in this format:

/*	$NetBSD: strdup.c,v 1.1.1.2 2007/01/27 21:08:47 christos Exp $	*/

#include "port_before.h"

#include <stdlib.h>

#include "port_after.h"

#ifndef NEED_STRDUP
int __bind_strdup_unneeded;
#else
char *
strdup(const char *src) {
	char *dst = malloc(strlen(src) + 1);

	if (dst)
		strcpy(dst, src);
	return (dst);
}
#endif

/*! \file */