summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorNathaniel W Filardo <nwf@cs.jhu.edu>2009-12-27 01:11:21 -0500
committerJunio C Hamano <gitster@pobox.com>2009-12-27 10:41:48 -0800
commit07cc8ecac0313c571cb9838585b376df86c80563 (patch)
treea76397a13d474ba21541ee11cfc3351887f77286 /read-cache.c
parent7a51ed66f653c248993b3c4a61932e47933d835e (diff)
downloadgit-07cc8ecac0313c571cb9838585b376df86c80563.tar.gz
read_index(): fix reading extension size on BE 64-bit archs
On big endian platforms with 8-byte unsigned long, the code reads the size of the index extension section (which is a 4-byte network byte order integer) incorrectly. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 82a6238b77..053bcf1916 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1016,7 +1016,7 @@ int read_index_from(struct index_state *istate, const char *path)
* extension name (4-byte) and section length
* in 4-byte network byte order.
*/
- unsigned long extsize;
+ uint32_t extsize;
memcpy(&extsize, (char *)mmap + src_offset + 4, 4);
extsize = ntohl(extsize);
if (read_index_extension(istate,