[sys] Override strdup for 32-bit windows

This fixes some nasty segfaults when calling free due to different
allocators being used.
This commit is contained in:
Bill Currie 2022-03-21 19:23:49 +09:00
parent 296c04c8eb
commit 939a73fb52

View file

@ -677,6 +677,15 @@ realloc (void *mem, size_t size)
{
return _aligned_realloc (mem, size, 16);
}
char *__cdecl
strdup(const char *src)
{
size_t len = strlen (src);
char *dup = malloc (len + 1);
strcpy (dup, src);
return dup;
}
#endif
VISIBLE size_t