[PATCH 4/5] libmultipath: simplify basenamecpy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



strlcpy() already does a strlen() at the end, so no need
to call it explicitly.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
---
 libmultipath/util.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libmultipath/util.c b/libmultipath/util.c
index 93ab08b..06a6311 100644
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -44,8 +44,7 @@ basenamecpy (const char * str1, char * str2, int str2len)
 
 	strncpy(str2, p, str2len);
 	str2[str2len - 1] = '\0';
-	strchop(str2);
-	return strlen(str2);
+	return strchop(str2);
 }
 
 int
-- 
1.7.12.4

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux