--- backup/2006082401tachibana/makedumpfile.c	2006-08-25 00:00:16.000000000 +0900
+++ ./makedumpfile.c	2006-08-30 12:20:52.000000000 +0900
@@ -1631,6 +1631,8 @@ write_pages(struct DumpInfo *info)
 				if (!write_cache_bufsz(&bm2))
 					goto out;
 			}
+			if (info->len_bitmap - bm2.offset < BUFSIZE_BITMAP)
+				bm2.cache_size = info->len_bitmap - bm2.offset;
 			if (!read_cache(&bm2))
 				goto out;
 			flag_change_bitmap = 0;
@@ -1757,7 +1759,7 @@ out:
 int write_dump_bitmap(struct DumpInfo *info)
 {
 	struct cache_data bm;
-	unsigned long buf_size;
+	long buf_size;
 	const off_t failed = (off_t)-1;
 
 	if (info->flag_elf_dumpfile)
