From e94d383b9ba7964da9fefac2a55e10c00ee72392 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 May 2008 12:54:33 -0600 Subject: egl: added eglstring.[ch] --- src/egl/main/eglstring.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/egl/main/eglstring.c (limited to 'src/egl/main/eglstring.c') 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 +#include +#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; +} + + + -- cgit v1.2.3