You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
372 B
22 lines
372 B
3 months ago
|
/*
|
||
|
* UCW Library -- String Allocation
|
||
|
*
|
||
|
* (c) 1997 Martin Mares <mj@ucw.cz>
|
||
|
*
|
||
|
* This software may be freely distributed and used according to the terms
|
||
|
* of the GNU Lesser General Public License.
|
||
|
*/
|
||
|
|
||
|
#include <ucw/lib.h>
|
||
|
|
||
|
#include <string.h>
|
||
|
|
||
|
char *
|
||
|
xstrdup(const char *s)
|
||
|
{
|
||
|
if (!s)
|
||
|
return NULL;
|
||
|
uint l = strlen(s) + 1;
|
||
|
return memcpy(xmalloc(l), s, l);
|
||
|
}
|