summaryrefslogtreecommitdiffstats
path: root/sbin/geom/class/raid3
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/raid3
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/raid3')
-rw-r--r--sbin/geom/class/raid3/geom_raid3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c
index 220fb09..7afc71e 100644
--- a/sbin/geom/class/raid3/geom_raid3.c
+++ b/sbin/geom/class/raid3/geom_raid3.c
@@ -244,8 +244,8 @@ raid3_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));
}
if (verify && md.md_no == md.md_all - 1) {
OpenPOWER on IntegriCloud