File: strdup.c

package info (click to toggle)
socks4-server 4.3.beta2-20
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 1,512 kB
  • ctags: 1,778
  • sloc: ansic: 19,305; makefile: 399; sh: 52
file content (15 lines) | stat: -rw-r--r-- 166 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* strdup */

#include <stdlib.h>
#include <string.h>

char *strdup(s)
char *s;
{
	char *p;

	p = (char *)malloc(strlen(s) + 1);
	if (p)
		strcpy(p, s);
	return p;
}