af-alg: Fix "'strncpy' specified bound equals destination size" warnings

This commit is contained in:
Tobias Brunner
2022-07-18 14:49:12 +02:00
parent 112bb465fb
commit 42ed6b44b2
@@ -218,8 +218,8 @@ af_alg_ops_t *af_alg_ops_create(char *type, char *alg)
.salg_family = AF_ALG, .salg_family = AF_ALG,
}; };
strncpy(sa.salg_type, type, sizeof(sa.salg_type)); strncpy(sa.salg_type, type, sizeof(sa.salg_type) - 1);
strncpy(sa.salg_name, alg, sizeof(sa.salg_name)); strncpy(sa.salg_name, alg, sizeof(sa.salg_name) - 1);
INIT(this, INIT(this,
.public = { .public = {