File: stdutil.c

package info (click to toggle)
cgiwrap 3.5-3
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 356 kB
  • ctags: 115
  • sloc: sh: 3,954; ansic: 1,036; perl: 104; makefile: 86
file content (28 lines) | stat: -rw-r--r-- 544 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
static char *rcsid="$Id: stdutil.c,v 1.8 1996/07/30 02:25:43 nneul Exp $";

/**
 **  File: stdutil.c
 **  Purpose: Home grown alternatives for routines not in standard library
 **/
 
#include "cgiwrap.h"	/* Headers for all CGIwrap source files */

/*
 * strdup() - copy a string into a newly allocated block of memory
 */
#if !defined(HAS_STRDUP)
char *strdup(char *str)
{
	char *temp;

	temp = (char *) malloc ( strlen(str) + 1 );
	if (!temp)
	{
		DoPError("Couldn't malloc memory for string!");
	}
	strcpy(temp,str);

	return temp;
}
#endif