mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
a41a0e28c2
Not hooked up to the build yet.
18 lines
185 B
C
18 lines
185 B
C
/*
|
|
* strdup.c
|
|
*/
|
|
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
char *strdup(const char *s)
|
|
{
|
|
int l = strlen(s)+1;
|
|
char *d = malloc(l);
|
|
|
|
if ( d )
|
|
memcpy(d, s, l);
|
|
|
|
return d;
|
|
}
|