fixed bug in reading of longs in archive header

This commit is contained in:
ceriel 1987-11-05 11:55:28 +00:00
parent 734d549473
commit 7d0a77821c

View file

@ -28,13 +28,13 @@ rd_arhdr(fd, arhdr)
while (i--) { while (i--) {
*p++ = *c++; *p++ = *c++;
} }
arhdr->ar_date = get2(c) << 16; c += 2; arhdr->ar_date = ((long) get2(c)) << 16; c += 2;
arhdr->ar_date |= get2(c) & 0xffff; c += 2; arhdr->ar_date |= ((long) get2(c)) & 0xffff; c += 2;
arhdr->ar_uid = *c++; arhdr->ar_uid = *c++;
arhdr->ar_gid = *c++; arhdr->ar_gid = *c++;
arhdr->ar_mode = get2(c); c += 2; arhdr->ar_mode = get2(c); c += 2;
arhdr->ar_size = get2(c) << 16; c += 2; arhdr->ar_size = (long) get2(c) << 16; c += 2;
arhdr->ar_size |= get2(c) & 0xffff; arhdr->ar_size |= (long) get2(c) & 0xffff;
} }
#if WORDS_REVERSED && !BYTES_REVERSED #if WORDS_REVERSED && !BYTES_REVERSED
else { else {