]> git.wh0rd.org - dump.git/blobdiff - dump/optr.c
Compatibility between dumps made on little endian machines vs. big endian machines...
[dump.git] / dump / optr.c
index 8287df5dcaf24c5e827f202d51816bf31e80afc4..de1d6f6fde171a16b6d19494c8f5ee1b3b4d6955 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: optr.c,v 1.8 2000/01/21 10:17:41 stelian Exp $";
+       "$Id: optr.c,v 1.10 2000/02/10 09:42:32 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -328,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;
@@ -427,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));