]> andersk Git - openssh.git/blobdiff - progressmeter.c
- (djm) Bug #573 - Remove unneeded Krb headers and compat goop. Patch from
[openssh.git] / progressmeter.c
index 90eb97f375f38bddb50e54da5abdf0c23fcc1c74..343e1b7d52cc8121e2891f874d393acbb52e1f58 100644 (file)
  */
 
 /*
- * Parts from:
+ * Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
  *
- * Copyright (c) 1983, 1990, 1992, 1993, 1995
- *     The Regents of the University of California.  All rights reserved.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  *    documentation and/or other materials provided with the distribution.
  * 3. All advertising materials mentioning features or use of this software
  *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
  *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: progressmeter.c,v 1.3 2003/03/17 10:38:38 markus Exp $");
+RCSID("$OpenBSD: progressmeter.c,v 1.6 2003/04/07 21:58:05 millert Exp $");
 
 #ifdef HAVE_LIBGEN_H
 #include <libgen.h>
@@ -211,36 +215,19 @@ draw_progress_meter()
 
        nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1);
 
-#ifdef HAVE_LONG_LONG_INT
        snprintf(buf, sizeof(buf),
            "\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s",
            curfile,
            nspaces,
            spaces,
            ratio,
-           (long long)abbrevsize,
-           prefixes[ai],
-           ai == 0 ? ' ' : 'B',
-           (long long)(bytespersec / 1024),
-           (int)((bytespersec % 1024) * 10 / 1024),
-           prefixes[bi]
-       );
-#else
-               /* XXX: Handle integer overflow? */
-       snprintf(buf, sizeof(buf),
-           "\r%-45.45s%.*s%3d%% %4lu%c%c %3lu.%01d%cB/s",
-           curfile,
-           nspaces,
-           spaces,
-           ratio,
-           (u_long)abbrevsize,
+           (int64_t)abbrevsize,
            prefixes[ai],
            ai == 0 ? ' ' : 'B',
-           (u_long)(bytespersec / 1024),
+           (int64_t)(bytespersec / 1024),
            (int)((bytespersec % 1024) * 10 / 1024),
            prefixes[bi]
        );
-#endif
 
        if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) {
                snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
This page took 0.440551 seconds and 4 git commands to generate.