* [PATCH] archive-tar: keep const in checksum calculation
@ 2012-05-18 5:18 René Scharfe
0 siblings, 0 replies; only message in thread
From: René Scharfe @ 2012-05-18 5:18 UTC (permalink / raw)
To: git discussion list; +Cc: Junio C Hamano
For correctness, don't needlessly drop the const qualifier when casting.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
archive-tar.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/archive-tar.c b/archive-tar.c
index 93387ea..dc91c6b 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -139,13 +139,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;
}
--
1.7.10.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-05-18 5:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 5:18 [PATCH] archive-tar: keep const in checksum calculation René Scharfe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).