diff mbox

[4/5] libmultipath: simplify basenamecpy()

Message ID 1387263848-73945-5-git-send-email-hare@suse.de (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Hannes Reinecke Dec. 17, 2013, 7:04 a.m. UTC
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 mbox

Patch

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