]> mj.ucw.cz Git - libucw.git/blob - ucw/alloc_str.c
Mempool: Implemented statistics about allocated bytes from memory pool to application.
[libucw.git] / ucw / alloc_str.c
1 /*
2  *      UCW Library -- String Allocation
3  *
4  *      (c) 1997 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #include <ucw/lib.h>
11
12 #include <string.h>
13
14 char *
15 xstrdup(const char *s)
16 {
17   if (!s)
18     return NULL;
19   uns l = strlen(s) + 1;
20   return memcpy(xmalloc(l), s, l);
21 }