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

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



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

Signed-off-by: Hannes Reinecke <hare suse de>
---
 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


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