From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - cov: always sure we end with '0'
Date: Tue, 1 Sep 2020 17:02:05 +0000 (GMT) [thread overview]
Message-ID: <20200901170205.53ECE3951C06@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1705b439b1babfcae75b1d54d45eb7909cbccfb9
Commit: 1705b439b1babfcae75b1d54d45eb7909cbccfb9
Parent: de837c15a55f4951f0b3181f4835fed2d824698b
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Sat Aug 29 19:56:37 2020 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Sep 1 17:57:50 2020 +0200
cov: always sure we end with '0'
Use easier dm_strncpy().
---
lib/label/hints.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/label/hints.c b/lib/label/hints.c
index 3125ae01d..c9d339861 100644
--- a/lib/label/hints.c
+++ b/lib/label/hints.c
@@ -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++;
}
reply other threads:[~2020-09-01 17:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200901170205.53ECE3951C06@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.