Back to index

nagios-plugins  1.4.16
Defines | Functions
strdup.c File Reference
#include <config.h>
#include <string.h>
#include <stdlib.h>

Go to the source code of this file.


#define __strdup   strdup


char * __strdup (const char *s)

Define Documentation

#define __strdup   strdup

Definition at line 35 of file strdup.c.

Function Documentation

char* __strdup ( const char *  s)

Definition at line 40 of file strdup.c.

  size_t len = strlen (s) + 1;
  void *new = malloc (len);

  if (new == NULL)
    return NULL;

  return (char *) memcpy (new, s, len);