msvcrt: Fix a crash in _strdup.

This commit is contained in:
Louis. Lenders 2006-06-21 09:55:11 +01:00 committed by Alexandre Julliard
parent a1910e11bb
commit 6d4a811cd5
1 changed files with 7 additions and 3 deletions

View File

@ -49,11 +49,15 @@ char* msvcrt_strndup(const char* buf, unsigned int size)
* _strdup (MSVCRT.@)
*/
char* CDECL _strdup(const char* str)
{
if(str)
{
char * ret = MSVCRT_malloc(strlen(str)+1);
if (ret) strcpy( ret, str );
return ret;
}
else return 0;
}
/*********************************************************************
* _strnset (MSVCRT.@)