mksquashfs: fix bug introduced changing fragment index in writer buffer

A recent commit changed the index used when storing compressed fragment
buffers in the writer cache to be negative.  This was to ensure
compressed fragments stored in the writer cache (indexed on the fragment
index) were distinct from compressed block buffers stored in the cache
(indexed on the start block in the output filesystem).

Unfortunately this broke compressed fragment buffer lookup in the
writer cache, which is done when looking up fragments in duplicate checking,
and the original uncompressed fragment buffer is no longer available
in the fragment cache.

Fragment->index is an unsigned int, and so when converted to a
negative index via FRAG_INDEX we get a large value rather than the
desired negative value.  Fix by casting to a long long.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index d5b27f3..6a34d98 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -1361,7 +1361,7 @@
 		return buffer;
 
 	compressed_buffer = cache_lookup(writer_buffer,
-						FRAG_INDEX(fragment->index));
+					FRAG_INDEX((long long) fragment->index));
 
 	buffer = cache_get(fragment_buffer, fragment->index);
 
@@ -4739,7 +4739,7 @@
 
 
 #define VERSION() \
-	printf("mksquashfs version 4.2-git (2013/05/14)\n");\
+	printf("mksquashfs version 4.2-git (2013/05/18)\n");\
 	printf("copyright (C) 2013 Phillip Lougher "\
 		"<phillip@squashfs.org.uk>\n\n"); \
 	printf("This program is free software; you can redistribute it and/or"\