1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: always sure we end with '0'

Use easier dm_strncpy().
This commit is contained in:
Zdenek Kabelac 2020-08-29 19:56:37 +02:00
parent de837c15a5
commit 1705b439b1

View File

@ -818,8 +818,7 @@ static int _read_hint_file(struct cmd_context *cmd, struct dm_list *hints, int *
while ((dev = dev_iter_get(cmd, iter))) {
if (!_dev_in_hint_hash(cmd, dev))
continue;
memset(devpath, 0, sizeof(devpath));
strncpy(devpath, dev_name(dev), PATH_MAX);
(void) dm_strncpy(devpath, dev_name(dev), sizeof(devpath));
calc_hash = calc_crc(calc_hash, (const uint8_t *)devpath, strlen(devpath));
calc_count++;
}