From patchwork Tue Dec 17 07:04:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 3359481 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8CCAC0D4A for ; Tue, 17 Dec 2013 07:07:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 108B120375 for ; Tue, 17 Dec 2013 07:07:57 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mail.kernel.org (Postfix) with ESMTP id 3822020348 for ; Tue, 17 Dec 2013 07:07:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBH74Cms017210; Tue, 17 Dec 2013 02:04:13 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBH74Bms012936 for ; Tue, 17 Dec 2013 02:04:11 -0500 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBH74BZ4000525 for ; Tue, 17 Dec 2013 02:04:11 -0500 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBH749Ge007066 for ; Tue, 17 Dec 2013 02:04:10 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4DC28AC0F; Tue, 17 Dec 2013 07:04:09 +0000 (UTC) From: Hannes Reinecke To: Christophe Varoqui Date: Tue, 17 Dec 2013 08:04:07 +0100 Message-Id: <1387263848-73945-5-git-send-email-hare@suse.de> In-Reply-To: <1387263848-73945-1-git-send-email-hare@suse.de> References: <1387263848-73945-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -7.434 (BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 4/5] libmultipath: simplify basenamecpy() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP strlcpy() already does a strlen() at the end, so no need to call it explicitly. Signed-off-by: Hannes Reinecke --- 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