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");
}
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) {