diff options
author | damien <damien> | 1999-11-13 02:22:46 +0000 |
---|---|---|
committer | damien <damien> | 1999-11-13 02:22:46 +0000 |
commit | 4eca30a52f65e806217b008324a3b0148718d611 (patch) | |
tree | 548da62665e66ab5fa62d14299593b36d585a3c8 /scp.c | |
parent | 00bbe54ef01ec19832fb96c9026587ff11b62644 (diff) | |
download | openssh-4eca30a52f65e806217b008324a3b0148718d611.tar.gz |
- Merged OpenBSD CVS changes:
- [bufaux.c] save a view malloc/memcpy/memset/free's, ok niels
- [scp.c] fix overflow reported by damien@ibs.com.au: off_t
totalsize, ok niels,aaron
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -42,11 +42,11 @@ and ssh has the necessary privileges.) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.5 1999/11/12 05:28:02 damien Exp $ + * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ */ #include "includes.h" -RCSID("$Id: scp.c,v 1.5 1999/11/12 05:28:02 damien Exp $"); +RCSID("$Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -70,7 +70,7 @@ static struct timeval start; volatile unsigned long statbytes; /* Total size of current file. */ -unsigned long totalbytes = 0; +off_t totalbytes = 0; /* Name of current file being transferred. */ char *curfile; @@ -976,7 +976,7 @@ run_err(const char *fmt, ...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scp.c,v 1.5 1999/11/12 05:28:02 damien Exp $ + * $Id: scp.c,v 1.6 1999/11/13 02:22:46 damien Exp $ */ char * @@ -1131,8 +1131,8 @@ progressmeter(int flag) } (void)gettimeofday(&now, (struct timezone *)0); cursize = statbytes; - if ((totalbytes >> 10) != 0) { - ratio = (cursize >> 10) * 100 / (totalbytes >> 10); + if (totalbytes != 0) { + ratio = cursize * 100 / totalbytes; ratio = MAX(ratio, 0); ratio = MIN(ratio, 100); } |