summaryrefslogtreecommitdiffstats
path: root/sbin/geom/class/journal
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2010-10-09 20:20:27 +0000
committerae <ae@FreeBSD.org>2010-10-09 20:20:27 +0000
commitab9dd3ef5837b16243ea56cca50dce6f2709cb92 (patch)
tree724bc9f6b5d1845293adad1d0f93b93234459cf7 /sbin/geom/class/journal
parent0061fd332ca7c71fd44b7390a2eb33e53f4539ce (diff)
downloadFreeBSD-src-ab9dd3ef5837b16243ea56cca50dce6f2709cb92.zip
FreeBSD-src-ab9dd3ef5837b16243ea56cca50dce6f2709cb92.tar.gz
Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1.
Suggested by: kib Approved by: kib (mentor) MFC after: 5 days
Diffstat (limited to 'sbin/geom/class/journal')
-rw-r--r--sbin/geom/class/journal/geom_journal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/geom/class/journal/geom_journal.c b/sbin/geom/class/journal/geom_journal.c
index b887fab..681ff47 100644
--- a/sbin/geom/class/journal/geom_journal.c
+++ b/sbin/geom/class/journal/geom_journal.c
@@ -269,8 +269,8 @@ journal_label(struct gctl_req *req)
if (!hardcode)
bzero(md.md_provider, sizeof(md.md_provider));
else {
- if (strncmp(str, _PATH_DEV, strlen(_PATH_DEV)) == 0)
- str += strlen(_PATH_DEV);
+ if (strncmp(str, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+ str += sizeof(_PATH_DEV) - 1;
strlcpy(md.md_provider, str, sizeof(md.md_provider));
}
journal_metadata_encode(&md, sector);
OpenPOWER on IntegriCloud