{"thread":{"id":"30551","subject":"[PATCH] archive-tar: keep const in checksum calculation","startedAt":"2012-05-18T05:18:11Z","lastAt":"2012-05-18T05:18:11Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"191646","messageId":"4FB5DB93.9000904@lsrfire.ath.cx","threadId":"30551","inReplyTo":null,"subject":"[PATCH] archive-tar: keep const in checksum calculation","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2012-05-18T05:18:11Z","receivedAt":"2012-05-18T05:18:11Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"For correctness, don't needlessly drop the const qualifier when casting.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n archive-tar.c |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/archive-tar.c b/archive-tar.c\nindex 93387ea..dc91c6b 100644\n--- a/archive-tar.c\n+++ b/archive-tar.c\n@@ -139,13 +139,13 @@ static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword,\n \n static unsigned int ustar_header_chksum(const struct ustar_header *header)\n {\n-\tchar *p = (char *)header;\n+\tconst char *p = (const char *)header;\n \tunsigned int chksum = 0;\n \twhile (p < header->chksum)\n \t\tchksum += *p++;\n \tchksum += sizeof(header->chksum) * ' ';\n \tp += sizeof(header->chksum);\n-\twhile (p < (char *)header + sizeof(struct ustar_header))\n+\twhile (p < (const char *)header + sizeof(struct ustar_header))\n \t\tchksum += *p++;\n \treturn chksum;\n }\n-- \n1.7.10.2\n"}]}