#include <mbari/types.h>
#include <stdio.h>
#include <string.h>

#ifdef UNIX
# include <malloc.h>
#else
# include <stdlib.h>
#endif

#include "vxUtils.h"

char *strdup(const char *src)
{
  int nbytes;
  char *buf;
  
  if ((nbytes = strlen(src)) <= 0)
    return (char *)NULL;
  
  /* Include space for terminating null byte */
  nbytes++;
  
  if ((buf = (char *)malloc(nbytes)) == (char *)NULL)
    return (char *)NULL;
  
  strcpy(buf, src);
  return buf;
}
