Use strlcpy instead of strncpy

This commit is contained in:
pscott
2021-07-27 12:23:55 +02:00
parent b7110eafe0
commit ee4a865144
4 changed files with 5 additions and 5 deletions

View File

@@ -66,7 +66,7 @@ bool check_contract(erc20_parameters_t *context) {
for (size_t i = 0; i < NUM_CONTRACTS; i++) {
contract_t *contract = (contract_t *) PIC(&CONTRACTS[i]);
if (memcmp(contract->address, context->destinationAddress, ADDRESS_LENGTH) == 0) {
strncpy(context->contract_name, contract->name, sizeof(context->contract_name));
strlcpy(context->contract_name, contract->name, sizeof(context->contract_name));
return true;
}
}