diff options
author | René Scharfe <l.s.r@web.de> | 2019-08-17 18:24:13 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-19 19:49:00 +0200 |
commit | 17e9ef00d29b349727e3c710869217a36ad08224 (patch) | |
tree | 1a00a9514e3ab7c16d896676b7277305e8eb17eb /archive-tar.c | |
parent | archive-tar: fix pax extended header length calculation (diff) | |
download | git-17e9ef00d29b349727e3c710869217a36ad08224.tar.xz git-17e9ef00d29b349727e3c710869217a36ad08224.zip |
archive-tar: use size_t in strbuf_append_ext_header()
One of its callers already passes in a size_t value. Use it
consistently in this function.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive-tar.c')
-rw-r--r-- | archive-tar.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/archive-tar.c b/archive-tar.c index 3d76977c3f..29ca21649e 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)); } /* |