msvcrt: Fix a crash in _strdup.
This commit is contained in:
parent
a1910e11bb
commit
6d4a811cd5
|
@ -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.@)
|
||||
|
|
Loading…
Reference in New Issue