summaryrefslogtreecommitdiff
path: root/src/egl/main/eglstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglstring.c')
-rw-r--r--src/egl/main/eglstring.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/egl/main/eglstring.c b/src/egl/main/eglstring.c
new file mode 100644
index 0000000000..ba7406158c
--- /dev/null
+++ b/src/egl/main/eglstring.c
@@ -0,0 +1,24 @@
+/**
+ * String utils.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "eglstring.h"
+
+
+char *
+_eglstrdup(const char *s)
+{
+ if (s) {
+ int l = strlen(s);
+ char *s2 = malloc(l + 1);
+ if (s2)
+ strcpy(s2, s);
+ return s2;
+ }
+ return NULL;
+}
+
+
+