/* NetBSD Compatibility Function strdup creates a duplicate copy of a string. */
char* strdup(const char *str)
/* NetBSD Compatibility Function strdup creates a duplicate copy of a string. */
char* strdup(const char *str)
{
  size_t  len;
  char    *copy;
  len = strlen (str) + 1;
  if ((copy = malloc (len)) == NULL) {
    return (NULL);
  }
  memcpy (copy, str, len);
  return (copy);
}