PSI sics-cvs-psi_pre-ansto

This commit is contained in:
2003-06-13 00:00:00 +00:00
committed by Douglas Clowes
parent 2e3ddfb6c6
commit 3ffd0d8af4
1099 changed files with 318432 additions and 0 deletions

29
strdup.c Normal file
View File

@@ -0,0 +1,29 @@
/* -----------------------------------------------------------------------
a replacement for strdup to make memdebug happy
Mark Koennecke, November 1996
-----------------------------------------------------------------------------*/
#include "fortify.h"
#include <string.h>
char *Fortify_STRDUP(const char *in, char *file,unsigned long lLine)
{
char *pResult = NULL;
if(!in)
return NULL;
pResult = (char *)Fortify_malloc((strlen(in)+2)*sizeof(char),file,lLine);
if(!pResult)
{
return NULL;
}
else
{
strcpy(pResult,in);
}
return pResult;
}