*** empty log message ***
[rsync/rsync.git] / checksum.c
index 8e9ad27..8d805b6 100644 (file)
@@ -67,7 +67,7 @@ void get_checksum2(char *buf,int len,char *sum)
 
   if (len > len1) {
     if (buf1) free(buf1);
-    buf1 = (char *)malloc(len+sizeof(checksum_seed));
+    buf1 = (char *)malloc(len+4);
     len1 = len;
     if (!buf1) out_of_memory("get_checksum2");
   }
@@ -76,8 +76,8 @@ void get_checksum2(char *buf,int len,char *sum)
 
   bcopy(buf,buf1,len);
   if (checksum_seed) {
-    bcopy((char *)&checksum_seed,buf1+len,sizeof(checksum_seed));
-    len += sizeof(checksum_seed);
+    SIVAL(buf1,len,checksum_seed);
+    len += 4;
   }
 
   for(i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) {
@@ -93,7 +93,7 @@ void file_checksum(char *fname,char *sum,off_t size)
 {
   int i;
   MDstruct MD;
-  char *buf;
+  struct map_struct *buf;
   int fd;
   int len = size;
   char tmpchunk[CSUM_CHUNK];
@@ -118,7 +118,7 @@ void file_checksum(char *fname,char *sum,off_t size)
   sum_put(&MD,sum);
 
   close(fd);
-  unmap_file(buf,size);
+  unmap_file(buf);
 }