Fix strncpy gcc warning.

This commit is contained in:
Milan Broz
2019-01-15 15:34:00 +01:00
parent 82a1f33260
commit ee8970c11e

View File

@@ -190,7 +190,7 @@ int crypt_hash_init(struct crypt_hash **ctx, const char *name)
}
h->hash_len = ha->length;
strncpy((char *)sa.salg_name, ha->kernel_name, sizeof(sa.salg_name));
strncpy((char *)sa.salg_name, ha->kernel_name, sizeof(sa.salg_name)-1);
if (crypt_kernel_socket_init(&sa, &h->tfmfd, &h->opfd, NULL, 0) < 0) {
free(h);