This commit was generated by cvs2svn to compensate for changes in r1815,
[bootcd.git] / syslinux / com32 / lib / strdup.c
diff --git a/syslinux/com32/lib/strdup.c b/syslinux/com32/lib/strdup.c
new file mode 100644 (file)
index 0000000..eb170c2
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * strdup.c
+ */
+
+#include <string.h>
+#include <stdlib.h>
+
+char *strdup(const char *s)
+{
+  int l = strlen(s)+1;
+  char *d = malloc(l);
+
+  if ( d )
+    memcpy(d, s, l);
+
+  return d;
+}