aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglstring.c
blob: e4ab19136fb77d056d4155156c43e9e9c36c6a9b (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) {
      size_t l = strlen(s);
      char *s2 = malloc(l + 1);
      if (s2)
         strcpy(s2, s);
      return s2;
   }
   return NULL;
}