Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup()

This commit is contained in:
Sam Lantinga 2018-02-13 08:13:29 -08:00
parent 3460188642
commit 12d8a48c9e

View file

@ -564,7 +564,7 @@ SDL_strdup(const char *string)
size_t len = SDL_strlen(string) + 1;
char *newstr = SDL_malloc(len);
if (newstr) {
SDL_strlcpy(newstr, string, len);
SDL_memcpy(newstr, string, len);
}
return newstr;
}