cvs_buf_free(fbuf);
cvs_recvfile(struct cvsroot *root, mode_t *mode){	size_t len;	ssize_t ret;	off_t fsz, cnt;	char buf[4096], *ep;	BUF *fbuf;	fbuf = cvs_buf_alloc(sizeof(buf), BUF_AUTOEXT);	if (fbuf == NULL)		return (NULL);	if ((cvs_getln(root, buf, sizeof(buf)) < 0) ||	    (cvs_strtomode(buf, mode) < 0)) {		return (NULL);	}	cvs_getln(root, buf, sizeof(buf));	fsz = (off_t)strtol(buf, &ep, 10);	if (*ep != '\0') {		cvs_log(LP_ERR, "parse error in file size transmission");		return (NULL);	}	cnt = 0;	do {		len = MIN(sizeof(buf), (size_t)(fsz - cnt));		if (len == 0)			break;		ret = cvs_recvraw(root, buf, len);		if (ret == -1) {			cvs_buf_free(fbuf);			return (NULL);		}		if (cvs_buf_append(fbuf, buf, (size_t)ret) == -1) {			cvs_log(LP_ERR,			    "failed to append received file data");			cvs_buf_free(fbuf);			return (NULL);		}		cnt += (off_t)ret;	} while (cnt < fsz);	return (fbuf);}