#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.41 2001/07/18 11:46:31 stelian Exp $";
#endif /* not lint */
#include <config.h>
#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__ */
return;
}
if (buf[0] != '\n') {
- (void) strcpy(magtape, buf);
- magtape[strlen(magtape) - 1] = '\0';
+ char *pos;
+ (void) strncpy(magtape, buf, sizeof(magtape));
+ magtape[sizeof(magtape) - 1] = '\0';
+ if ((pos = strchr(magtape, '\n')))
+ magtape[pos - magtape] = '\0';
}
}
#ifdef RRESTORE