Cy Schubert 2b15cb3d09 MFV ntp 4.2.8p1 (r258945, r275970, r276091, r276092, r276093, r278284)
Thanks to roberto for providing pointers to wedge this into HEAD.

Approved by:	roberto
2015-03-30 13:30:15 +00:00

31 lines
372 B
C

#include <config.h>
#include <string.h>
#include "ntp_malloc.h"
#ifndef HAVE_STRDUP
char *strdup(const char *s);
char *
strdup(
const char *s
)
{
size_t octets;
char * cp;
if (s) {
octets = 1 + strlen(s);
cp = malloc(octets);
if (NULL != cp)
memcpy(cp, s, octets);
else
cp = NULL;
return(cp);
}
#else
int strdup_c_nonempty_compilation_unit;
#endif