summaryrefslogtreecommitdiff
path: root/apps/plugins/mikmod/strdup.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mikmod/strdup.c')
-rw-r--r--apps/plugins/mikmod/strdup.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/plugins/mikmod/strdup.c b/apps/plugins/mikmod/strdup.c
new file mode 100644
index 0000000000..f8c1438bee
--- /dev/null
+++ b/apps/plugins/mikmod/strdup.c
@@ -0,0 +1,23 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
4
5#include <stdlib.h>
6#include <string.h>
7#include "mikmod.h"
8
9#undef strdup
10
11char* strdup(const char *__s)
12{
13 char *charptr;
14
15 if (!__s)
16 return NULL;
17
18 charptr=(char *)MikMod_malloc(sizeof(char) * (strlen(__s) + 1));
19 if (charptr)
20 strcpy(charptr, __s);
21
22 return charptr;
23}