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:
parent
944c67f6c1
commit
c98f0e0b9b
@ -119,7 +119,7 @@ elftc_string_table_add_to_pool(Elftc_String_Table *st, const char *string)
|
|||||||
st->st_string_pool_size = newsize;
|
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);
|
ELFTC_STRING_TABLE_UPDATE_LENGTH(st, stlen + len);
|
||||||
|
|
||||||
return (stlen);
|
return (stlen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user