projects
/
apps
/
madmutt.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
0249a058f7e994dbf00fc099f29cf5d769ffed42
[apps/madmutt.git]
/
strdup.c
1
/* ultrix doesn't have strdup */
2
3
#include <string.h>
4
#include <stdlib.h>
5
6
char *strdup (const char *s) /* __MEM_CHECKED__ */
7
{
8
char *d;
9
10
if (s == NULL)
11
return NULL;
12
13
if ((d = malloc (strlen (s) + 1)) == NULL) /* __MEM_CHECKED__ */
14
return NULL;
15
16
memcpy (d, s, strlen (s) + 1);
17
return d;
18
}
19