mirror of
https://github.com/akheron/jansson.git
synced 2025-04-07 06:25:02 +00:00
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:
parent
3196ad48ed
commit
21599b95f8
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue