Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/elftoolchain/libelftc/elftc_string_table.c
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | newsize = roundup(st->st_string_pool_size + | ||||
ELFTC_STRING_TABLE_POOL_SIZE_INCREMENT); | ELFTC_STRING_TABLE_POOL_SIZE_INCREMENT); | ||||
if ((newpool = realloc(st->st_string_pool, newsize)) == | if ((newpool = realloc(st->st_string_pool, newsize)) == | ||||
NULL) | NULL) | ||||
return (0); | return (0); | ||||
st->st_string_pool = newpool; | st->st_string_pool = newpool; | ||||
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); | ||||
} | } | ||||
Elftc_String_Table * | Elftc_String_Table * | ||||
elftc_string_table_create(int sizehint) | elftc_string_table_create(int sizehint) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 260 Lines • Show Last 20 Lines |