Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
archive-tar: keep const in checksum calculation
author
René Scharfe
<rene.scharfe@lsrfire.ath.cx>
Fri, 18 May 2012 05:18:11 +0000
(07:18 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 18 May 2012 18:26:18 +0000
(11:26 -0700)
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>
archive-tar.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
c51a351
)
diff --git
a/archive-tar.c
b/archive-tar.c
index 20af0051a334a1357b055ea10d74f5380117ab68..55cccecadf41558aa780434eb23262a537df9232 100644
(file)
--- 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)
{
- c
har *p = (
char *)header;
+ c
onst 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 < (c
onst c
har *)header + sizeof(struct ustar_header))
chksum += *p++;
return chksum;
}