]> git.wh0rd.org - dump.git/blobdiff - restore/tape.c
Check for the e2fsprogs header <ext2fs/ext2_fs.h> instead of the kernel header if...
[dump.git] / restore / tape.c
index 5fac380f1024641b4969e204f83e9961a9706f79..ee5c72fc35392003c72bd8e560219afc38a4ed1b 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.38 2001/05/12 11:36:12 stelian Exp $";
+       "$Id: tape.c,v 1.40 2001/06/18 10:58:28 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -67,7 +67,11 @@ static const char rcsid[] =
 #ifdef __linux__
 #include <sys/time.h>
 #include <time.h>
+#ifdef HAVE_EXT2FS_EXT2_FS_H
+#include <ext2fs/ext2_fs.h>
+#else
 #include <linux/ext2_fs.h>
+#endif
 #include <ext2fs/ext2fs.h>
 #include <bsdcompat.h>
 #else  /* __linux__ */
@@ -448,8 +452,8 @@ again:
                        return;
                }
                if (buf[0] != '\n') {
-                       (void) strcpy(magtape, buf);
-                       magtape[strlen(magtape) - 1] = '\0';
+                       (void) strncpy(magtape, buf, sizeof(magtape));
+                       magtape[sizeof(magtape) - 1] = '\0';
                }
        }
 #ifdef RRESTORE