diff options
author | ae <ae@FreeBSD.org> | 2010-10-09 20:20:27 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2010-10-09 20:20:27 +0000 |
commit | ab9dd3ef5837b16243ea56cca50dce6f2709cb92 (patch) | |
tree | 724bc9f6b5d1845293adad1d0f93b93234459cf7 /sys/geom/virstor | |
parent | 0061fd332ca7c71fd44b7390a2eb33e53f4539ce (diff) | |
download | FreeBSD-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/virstor')
-rw-r--r-- | sys/geom/virstor/g_virstor.c | 8 |
1 files changed, 4 insertions, 4 deletions
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++) { |