Replace strcpy with memcpy

Since len is known, the copy function does not need to check byte by byte
the end of the string.

Signed-off-by: Olivier Langlois <olivier@olivierlanglois.net>
This commit is contained in:
Olivier Langlois 2013-08-27 22:47:18 -04:00
parent 3196ad48ed
commit 21599b95f8

View file

@ -45,7 +45,7 @@ char *jsonp_strdup(const char *str)
if(!new_str)
return NULL;
strcpy(new_str, str);
memcpy(new_str, str, len + 1);
return new_str;
}