msvcrt: Fix a crash in _strdup.
This commit is contained in:
parent
a1910e11bb
commit
6d4a811cd5
|
@ -50,9 +50,13 @@ char* msvcrt_strndup(const char* buf, unsigned int size)
|
|||
*/
|
||||
char* CDECL _strdup(const char* str)
|
||||
{
|
||||
char * ret = MSVCRT_malloc(strlen(str)+1);
|
||||
if (ret) strcpy( ret, str );
|
||||
return ret;
|
||||
if(str)
|
||||
{
|
||||
char * ret = MSVCRT_malloc(strlen(str)+1);
|
||||
if (ret) strcpy( ret, str );
|
||||
return ret;
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
Loading…
Reference in New Issue