Back to index

tetex-bin  3.0
Defines | Functions
strdup.c File Reference
#include "strdup.h"
#include <stdlib.h>
#include <string.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 36 of file strdup.c.

Function Documentation

char* __strdup ( const char *  s)

Definition at line 41 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);

Here is the call graph for this function: