aboutsummaryrefslogtreecommitdiff
path: root/archive-tar.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2012-05-18 07:18:11 +0200
committerJunio C Hamano <gitster@pobox.com>2012-05-18 11:26:18 -0700
commitbf38245be8f481ac1c08a98951b7fd00bbfc15ea (patch)
tree46bacd2cec78633757615ea4f9c6987225e52aa8 /archive-tar.c
parentc51a351a6bcc64ad8cb2ed5a6ebde54b8d50eef1 (diff)
downloadgit-bf38245be8f481ac1c08a98951b7fd00bbfc15ea.tar.gz
git-bf38245be8f481ac1c08a98951b7fd00bbfc15ea.tar.xz
archive-tar: keep const in checksum calculation
For correctness, don't needlessly drop the const qualifier when casting. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive-tar.c')
-rw-r--r--archive-tar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archive-tar.c b/archive-tar.c
index 20af0051a..55cccecad 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -101,13 +101,13 @@ static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword,
static unsigned int ustar_header_chksum(const struct ustar_header *header)
{
- char *p = (char *)header;
+ const char *p = (const char *)header;
unsigned int chksum = 0;
while (p < header->chksum)
chksum += *p++;
chksum += sizeof(header->chksum) * ' ';
p += sizeof(header->chksum);
- while (p < (char *)header + sizeof(struct ustar_header))
+ while (p < (const char *)header + sizeof(struct ustar_header))
chksum += *p++;
return chksum;
}