int
csum1(int fd, uint32_t *cval, off_t *clen)
{
- int nr;
+ ssize_t nr;
u_int lcrc;
off_t total;
u_char *p;
* 16-bit checksum, rotating right before each addition;
* overflow is discarded.
*/
- lcrc = total = 0;
+ lcrc = 0;
+ total = 0;
while ((nr = read(fd, buf, sizeof(buf))) > 0)
for (total += nr, p = buf; nr--; ++p) {
if (lcrc & 1)