From ab9dd3ef5837b16243ea56cca50dce6f2709cb92 Mon Sep 17 00:00:00 2001 From: ae Date: Sat, 9 Oct 2010 20:20:27 +0000 Subject: Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1. Suggested by: kib Approved by: kib (mentor) MFC after: 5 days --- sys/geom/virstor/g_virstor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/geom/virstor') 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++) { -- cgit v1.1