Fix a rounding error in the block size calculation.

Submitted by:	tjr
This commit is contained in:
Dag-Erling Smørgrav 2002-12-14 13:38:49 +00:00
parent d241a89d5c
commit b6fd52a01d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107857

View File

@ -76,6 +76,7 @@
#include "includes.h"
RCSID("$OpenBSD: scp.c,v 1.91 2002/06/19 00:27:55 deraadt Exp $");
RCSID("$FreeBSD$");
#include "xmalloc.h"
#include "atomicio.h"
@ -1039,8 +1040,7 @@ allocbuf(bp, fd, blksize)
if (stb.st_blksize == 0)
size = blksize;
else
size = blksize + (stb.st_blksize - blksize % stb.st_blksize) %
stb.st_blksize;
size = roundup(stb.st_blksize, blksize);
#else /* HAVE_STRUCT_STAT_ST_BLKSIZE */
size = blksize;
#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */