diff src/libvorbis-1.3.3/macos/compat/strdup.c @ 1:05aa0afa9217

Bring in flac, ogg, vorbis
author Chris Cannam
date Tue, 19 Mar 2013 17:37:49 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/libvorbis-1.3.3/macos/compat/strdup.c	Tue Mar 19 17:37:49 2013 +0000
@@ -0,0 +1,21 @@
+#include <ogg/os_types.h>
+#include <sys/types.h>
+#include <string.h>
+#include <stdlib.h>
+
+char *strdup(const char *inStr)
+{
+        char *outStr = NULL;
+        
+        if (inStr == NULL) {
+                return NULL;
+        }
+        
+        outStr = _ogg_malloc(strlen(inStr) + 1);
+        
+        if (outStr != NULL) {
+                strcpy(outStr, inStr);
+        }
+        
+        return outStr;
+}