From patchwork Sat Aug 17 16:24:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 11099173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A8C21399 for ; Sat, 17 Aug 2019 16:24:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AE9720881 for ; Sat, 17 Aug 2019 16:24:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EF58289A0; Sat, 17 Aug 2019 16:24:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AD802899D for ; Sat, 17 Aug 2019 16:24:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726220AbfHQQYQ (ORCPT ); Sat, 17 Aug 2019 12:24:16 -0400 Received: from mout.web.de ([212.227.15.14]:53257 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbfHQQYQ (ORCPT ); Sat, 17 Aug 2019 12:24:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1566059053; bh=6EA/LZJS6omXR7+upmppamUGTLDaHLjbc/vwR3z2mic=; h=X-UI-Sender-Class:Subject:From:To:Cc:References:Date:In-Reply-To; b=rBnfhO5hBWk4FAqms8A1DtAhrYh0MczowkuOdLYyWOhWA756Vw1wLtYtdw4iJd6/d 0fdr5NgcWl4QDnNJTKKC4/CfF4c9qFH/1Q/Unh897ZTeNkBjKOfuIXb1JKwIwn1WWI 4Scix1dBaQu0hK2fjkUSPdsW5DpIe1zPf82CFNPc= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.23] ([79.203.24.71]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lb289-1ifBvo2Vsf-00kdAy; Sat, 17 Aug 2019 18:24:13 +0200 Subject: [PATCH 3/4] archive-tar: use size_t in strbuf_append_ext_header() From: =?utf-8?q?Ren=C3=A9_Scharfe?= To: Git Mailing List Cc: Junio C Hamano References: Message-ID: <1933ad5e-612f-b5ce-065b-f435338c3c9c@web.de> Date: Sat, 17 Aug 2019 18:24:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:Il3LCK8RX4jNjDrcKWOqOjzDVeSiSgV5jkbIm+ajX6wRnCncMeN oxuW3BjqeS4nQM/Tvy/ZlaP3qR55/+mwlqquPI7ttd62VzH7txImihWw4yLkfPZYhT1EUJL qcOTTHUUiWWfwD7p7pMaH5Z5gCVszjgSW8sxSUYnUAEKw8Cs1zdcC5o1IjQukgISJK4X7z0 BciaaKfmZRlMTBOGQjlDA== X-UI-Out-Filterresults: notjunk:1;V03:K0:qD4jKnagt4o=:FAK19FPM6PF1lVJ9eD7a8S 0Qcrt7uCWlKt1CfpaMLf+Do09z55f1T7vBmYbrY138rma4gU3ieEH3ARBVe2dRe/78eT3dL0d F0o+meRVbAc/3ghOFNg3JpreZl8YEwV+BMM3fMr4uB7oY3H1on5kK0/BgUNd8OKuC+HxvyeKi UWVirA58gWFfHLc8AkfN8cyF0EiJY2H5sxkBG3RugLSP4R5W3rCcDB66R4bwpkYm5QK57YLyG 1ReewSLLdkFP6Q9HQ/1s2kLsWyVdZT0S3yWb6J4Ox3176igv77ugzFIdqNnKGh5FnPwgn55gT c8Le/H18F/bYgHSFhDVslf0DWUPNT7t3rnpwfk0gZ8oP7U1DxuOwhXI/ZP298J5ZtBsuczwFH kiR151EGmLi0ebztGZc+vYVgfIaZDogv3QtcNQRsSqJiUXmjt1qGumZDyycmes9hkOHzf0RBN h2CieZv1LuPRzVjSwgyf0Sy+7s25ln5LqJ4os/LdNAAcvZARB73InrB4eg8bPsUR25II6yBKr Pa3IDW6o1gV3cpFeCcFi5tovPwwd9ixFxXjF+bVyn+MYWTk2YFvMPfX7qL43uEPpMLkMNaTlw KMn4kVLeDkXReSkGnteH8kBhn9DATyZ/Y8qFZ76mEL8bUn2Z0CnaOZB3WHbxYJf12MBWgU/dS El90nK5JXAj3IK/zBUcJKc+lTNrsurBZe+rkg50zSRw3FnUttOIvMzVotXSeo+2i4dAt0OxHD FdAIgXypH7LYGy5yHAT7/Rr46lxbUt1kCS7Wg+DwWDgccnedOmM4CtLCFpfNKyGB/Teh3fWa1 nmTp+bevKodb0jKUmYQfSH/9Blz8Fd5+tKtT+GKo1Bz4YYGADlNJdS5f3CcFETAEww4Us5FK0 +2DUeGOmyLcT02VbhftzY7D8009hN1oPoE7KMg/e3bphliSVcwnoH6H2rfvpFSEm/EJ2Og8Xu uPs5l+oopQ0tk16lV0OYD/X0j786cKTZBdQrtFXQS7qL3Y89wSMOzDCla7DTq7mdIfWgA5ALa KQ7apLiZEufC6WpGoYEB8fnZgBIZZdyKPXd+q1SSTv2P6ny5B7G2q1CFoacYAwVRsOwGWcoh4 tvtpaQktBv+6v4SnVVUeGAwAaqD4fvagOcPHiD6+YP8cSneJglSsPRlo0gUxI88Q7OJW3FeXb bM3ao= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP One of its callers already passes in a size_t value. Use it consistently in this function. Signed-off-by: René Scharfe --- archive-tar.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.23.0 diff --git a/archive-tar.c b/archive-tar.c index 4395a29ffb..9d09edd547 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -142,10 +142,10 @@ static int stream_blocked(const struct object_id *oid) * string and appends it to a struct strbuf. */ static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword, - const char *value, unsigned int valuelen) + const char *value, size_t valuelen) { size_t orig_len = sb->len; - int len, tmp; + size_t len, tmp; /* "%u %s=%s\n" */ len = 1 + 1 + strlen(keyword) + 1 + valuelen + 1; @@ -153,14 +153,14 @@ static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword, len++; strbuf_grow(sb, len); - strbuf_addf(sb, "%u %s=", len, keyword); + strbuf_addf(sb, "%"PRIuMAX" %s=", (uintmax_t)len, keyword); strbuf_add(sb, value, valuelen); strbuf_addch(sb, '\n'); if (len != sb->len - orig_len) - warning("pax extended header length miscalculated as %d" + warning("pax extended header length miscalculated as %"PRIuMAX ", should be %"PRIuMAX, - len, (uintmax_t)(sb->len - orig_len)); + (uintmax_t)len, (uintmax_t)(sb->len - orig_len)); } /*