Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup()
authorSam Lantinga <slouken@libsdl.org>
Tue, 13 Feb 2018 08:13:29 -0800
changeset 1186968864895c386
parent 11868 5ec7bc5b3d12
child 11870 b548450528c9
Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup()
src/stdlib/SDL_string.c
     1.1 --- a/src/stdlib/SDL_string.c	Tue Feb 13 08:07:52 2018 -0800
     1.2 +++ b/src/stdlib/SDL_string.c	Tue Feb 13 08:13:29 2018 -0800
     1.3 @@ -564,7 +564,7 @@
     1.4      size_t len = SDL_strlen(string) + 1;
     1.5      char *newstr = SDL_malloc(len);
     1.6      if (newstr) {
     1.7 -        SDL_strlcpy(newstr, string, len);
     1.8 +        SDL_memcpy(newstr, string, len);
     1.9      }
    1.10      return newstr;
    1.11  }