]> git.wh0rd.org - dump.git/blobdiff - restore/main.c
Fix maps overflow in restore when doing incremental restores (and MAXINO becomes...
[dump.git] / restore / main.c
index 2f2db7a192c832aae6683f15246884f266eb98e6..c8c76a9536b8dd9818c336b65946e311e5401fea 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.40 2002/06/08 07:10:37 stelian Exp $";
+       "$Id: main.c,v 1.42 2002/11/15 09:25:41 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -90,8 +90,8 @@ char  command = '\0';
 long   dumpnum = 1;
 long   volno = 0;
 long   ntrec;
-char   *dumpmap;
-char   *usedinomap;
+char   *dumpmap = NULL;
+char   *usedinomap = NULL;
 dump_ino_t maxino;
 time_t dumptime;
 time_t dumpdate;
@@ -554,10 +554,10 @@ main(int argc, char *argv[])
                        errx(1, "can't create tapeposfile\n");
                /* print QFA-file header */
                sprintf(gTps, "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION,(unsigned long)spcl.c_date);
-               if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps))
+               if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
                        errx(1, "can't write tapeposfile\n");
                sprintf(gTps, "ino\ttapeno\ttapepos\n");
-               if (write(gTapeposfd, gTps, strlen(gTps)) != strlen(gTps))
+               if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
                        errx(1, "can't write tapeposfile\n");
 
                extractdirs(1);