Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 461768c317..7f4145c187 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -917,23 +917,19 @@ static unsigned long unpack_object_header(struct packed_git *p, unsigned long of
enum object_type *type, unsigned long *sizep)
{
unsigned shift;
- unsigned char *pack, c;
+ unsigned char c;
unsigned long size;
if (offset >= p->pack_size)
die("object offset outside of pack file");
-
- pack = (unsigned char *) p->pack_base + offset;
- c = *pack++;
- offset++;
+ c = *((unsigned char *)p->pack_base + offset++);
*type = (c >> 4) & 7;
size = c & 15;
shift = 4;
while (c & 0x80) {
if (offset >= p->pack_size)
die("object offset outside of pack file");
- c = *pack++;
- offset++;
+ c = *((unsigned char *)p->pack_base + offset++);
size += (c & 0x7f) << shift;
shift += 7;
}