File:  [DVB] / dietlibc / lib / strdup.c
Revision 1.2: download - view: text, annotated - select for diffs
Sat Nov 17 14:29:53 2007 UTC (16 years, 6 months ago) by leitner
Branches: MAIN
CVS tags: HEAD
for some bizarre reason, strdup misbehaved.

#include <string.h>
#include <stdlib.h>

char *strdup(const char *s) {
  size_t l=strlen(s)+1;
  char *tmp=(char *)malloc(l);
  if (!tmp) return 0;
  return memcpy(tmp,s,l);
}

LinuxTV legacy CVS <linuxtv.org/cvs>