Commit 3b4c2fdf5d5ce7e7b281dd01708855b06da59bff

Sam Lantinga 2018-02-13T08:13:29

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

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
index 640c30a..444ae6d 100644
--- a/src/stdlib/SDL_string.c
+++ b/src/stdlib/SDL_string.c
@@ -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;
 }