Replace strncpy with strlcpy
Since destination size equals number of characters to copy. Pointed out by gcc8. [-Werror=stringop-truncation] Change-Id: I8f2118129ec2324bb1f93857f5abfdf121c864f0 Reviewed-on: https://review.haiku-os.org/450 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com> Reviewed-by: Skipp_OSX <jscipione@gmail.com>
This commit is contained in:
parent
b8761dc31c
commit
00cbe4ccca
@ -207,7 +207,7 @@ BNetworkRoster::GetNextPersistentNetwork(uint32* cookie,
|
||||
return B_ERROR;
|
||||
|
||||
memset(network.name, 0, sizeof(network.name));
|
||||
strncpy(network.name, networkName.String(), sizeof(network.name));
|
||||
strlcpy(network.name, networkName.String(), sizeof(network.name));
|
||||
|
||||
BNetworkAddress address;
|
||||
if (networkMessage.FindFlat("address", &network.address) != B_OK)
|
||||
|
Loading…
Reference in New Issue
Block a user