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

@@ -416,7 +416,7 @@ void finalizeParsing(bool direct) {
tmpContent.txContent.nonce.length,
&nonce);
tostring256(&nonce, 10, displayBuffer, sizeof(displayBuffer));
strncpy(strings.common.nonce, displayBuffer, sizeof(strings.common.nonce));
strlcpy(strings.common.nonce, displayBuffer, sizeof(strings.common.nonce));
}
// Compute maximum fee
if (genericUI) {
@@ -444,7 +444,7 @@ void finalizeParsing(bool direct) {
}
} else {
// Network name found, simply copy it.
strncpy(strings.common.network_name, name, sizeof(strings.common.network_name));
strlcpy(strings.common.network_name, name, sizeof(strings.common.network_name));
}
}