summaryrefslogtreecommitdiff
path: root/src/egl/main/eglstring.c
blob: ba7406158c463b3eb04fdcaf6095d2ecb30b8a29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
}