libelftc: Micro-optimize string table insertion.

The string's length is already known, so use memcpy() instead of
strcpy() to add it to the string table image.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20760
This commit is contained in:
markj 2019-06-26 16:30:14 +00:00
parent 944c67f6c1
commit c98f0e0b9b

View File

@ -119,7 +119,7 @@ elftc_string_table_add_to_pool(Elftc_String_Table *st, const char *string)
st->st_string_pool_size = newsize;
}
strcpy(st->st_string_pool + stlen, string);
memcpy(st->st_string_pool + stlen, string, len);
ELFTC_STRING_TABLE_UPDATE_LENGTH(st, stlen + len);
return (stlen);