summaryrefslogtreecommitdiffstats
path: root/sys/geom
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 /sys/geom
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 'sys/geom')
-rw-r--r--sys/geom/part/g_part.c8
-rw-r--r--sys/geom/virstor/g_virstor.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 9e7c9c0..eb7dcda 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -305,8 +305,8 @@ g_part_parm_geom(struct gctl_req *req, const char *name, struct g_geom **v)
gname = gctl_get_asciiparam(req, name);
if (gname == NULL)
return (ENOATTR);
- if (strncmp(gname, _PATH_DEV, strlen(_PATH_DEV)) == 0)
- gname += strlen(_PATH_DEV);
+ if (strncmp(gname, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+ gname += sizeof(_PATH_DEV) - 1;
LIST_FOREACH(gp, &g_part_class.geom, geom) {
if (!strcmp(gname, gp->name))
break;
@@ -329,8 +329,8 @@ g_part_parm_provider(struct gctl_req *req, const char *name,
pname = gctl_get_asciiparam(req, name);
if (pname == NULL)
return (ENOATTR);
- if (strncmp(pname, _PATH_DEV, strlen(_PATH_DEV)) == 0)
- pname += strlen(_PATH_DEV);
+ if (strncmp(pname, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+ pname += sizeof(_PATH_DEV) - 1;
pp = g_provider_by_name(pname);
if (pp == NULL) {
gctl_error(req, "%d %s '%s'", EINVAL, name, pname);
diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c
index efdba4b..38ce782 100644
--- a/sys/geom/virstor/g_virstor.c
+++ b/sys/geom/virstor/g_virstor.c
@@ -316,8 +316,8 @@ virstor_ctl_add(struct gctl_req *req, struct g_class *cp)
g_topology_unlock();
return;
}
- if (strncmp(prov_name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
- prov_name += strlen(_PATH_DEV);
+ if (strncmp(prov_name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+ prov_name += sizeof(_PATH_DEV) - 1;
pp = g_provider_by_name(prov_name);
if (pp == NULL) {
@@ -574,8 +574,8 @@ virstor_ctl_remove(struct gctl_req *req, struct g_class *cp)
gctl_error(req, "Error fetching argument '%s'", param);
return;
}
- if (strncmp(prov_name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
- prov_name += strlen(_PATH_DEV);
+ if (strncmp(prov_name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+ prov_name += sizeof(_PATH_DEV) - 1;
found = -1;
for (j = 0; j < sc->n_components; j++) {
OpenPOWER on IntegriCloud