X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Foptr.c;h=de1d6f6fde171a16b6d19494c8f5ee1b3b4d6955;hb=8eb05297aafdfd88bbd946a35d4db771604503bd;hp=6c2efb703287a6ad2d80ef52c7b33b5dfd680285;hpb=ec387a1267f4cac7625cd5b6d1c1f080d39085b3;p=dump.git diff --git a/dump/optr.c b/dump/optr.c index 6c2efb7..de1d6f6 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -2,8 +2,7 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999 - * + * Stelian Pop , 1999-2000 */ /*- @@ -37,10 +36,13 @@ * 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. - * - * $Id: optr.c,v 1.5 1999/10/11 13:31:11 stelian Exp $ */ +#ifndef lint +static const char rcsid[] = + "$Id: optr.c,v 1.10 2000/02/10 09:42:32 stelian Exp $"; +#endif /* not lint */ + #include #include #include @@ -326,6 +328,8 @@ timeest(void) tschedule = tnow + 300; if (blockswritten < 500) return; + if (blockswritten > tapesize) + tapesize = blockswritten; deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing)) / blockswritten * tapesize; @@ -356,8 +360,14 @@ msg(fmt, va_alist) va_start(ap); #endif (void) vfprintf(stderr, fmt, ap); + va_end(ap); (void) fflush(stdout); (void) fflush(stderr); +#ifdef __STDC__ + va_start(ap, fmt); +#else + va_start(ap); +#endif (void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap); va_end(ap); } @@ -419,8 +429,11 @@ allocfsent(struct fstab *fs) register struct fstab *new; new = (struct fstab *)malloc(sizeof (*fs)); - if (new == NULL || - (new->fs_file = strdup(fs->fs_file)) == NULL || + if (new == NULL) + quit("%s\n", strerror(errno)); + if (strlen(fs->fs_file) > 1 && fs->fs_file[strlen(fs->fs_file) - 1] == '/') + fs->fs_file[strlen(fs->fs_file) - 1] = '\0'; + if ((new->fs_file = strdup(fs->fs_file)) == NULL || (new->fs_type = strdup(fs->fs_type)) == NULL || (new->fs_spec = strdup(fs->fs_spec)) == NULL) quit("%s\n", strerror(errno));