]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Fix division-by-zero error
authorDamien Miller <djm@mindrot.org>
Fri, 12 Nov 1999 05:28:02 +0000 (16:28 +1100)
committerDamien Miller <djm@mindrot.org>
Fri, 12 Nov 1999 05:28:02 +0000 (16:28 +1100)
ChangeLog
scp.c

index 1ecaed30b28c4152649cda73ccdd00906dec9ef1..14fdfa10e270008c900b19d558ac80f2dbf8bea3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,8 @@
    - [mpaux.c] clear temp buffer
    - [servconf.c] print _all_ bad options found in configfile
  - Make ssh-askpass support optional through autoconf
+ - Fix nasty division-by-zero error in scp.c
+ - Released 1.2pre11
 
 19991111
  - Added (untested) Entropy Gathering Daemon (EGD) support
diff --git a/scp.c b/scp.c
index d31eb5cb55e5f92fa5e5e03aecbb1401fc6193dd..95160e81facc049c61e9fd23c92f5b6ba10a7e27 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -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.4 1999/11/11 10:39:50 damien Exp $
+ *     $Id: scp.c,v 1.5 1999/11/12 05:28:02 damien Exp $
  */
 
 #include "includes.h"
-RCSID("$Id: scp.c,v 1.4 1999/11/11 10:39:50 damien Exp $");
+RCSID("$Id: scp.c,v 1.5 1999/11/12 05:28:02 damien Exp $");
 
 #include "ssh.h"
 #include "xmalloc.h"
@@ -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.4 1999/11/11 10:39:50 damien Exp $
+ *     $Id: scp.c,v 1.5 1999/11/12 05:28:02 damien Exp $
  */
 
 char *
@@ -1131,7 +1131,7 @@ progressmeter(int flag)
        }   
        (void)gettimeofday(&now, (struct timezone *)0);
        cursize = statbytes;
-       if (totalbytes != 0) {
+       if ((totalbytes >> 10) != 0) {
                ratio = (cursize >> 10) * 100 / (totalbytes >> 10);
                ratio = MAX(ratio, 0);
                ratio = MIN(ratio, 100);