* 93/04/22 - Creation
*/
+#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include "ext2fs/ext2_fs.h"
#include "../version.h"
-#include "nls-enable.h"
+#include "support/nls-enable.h"
#define LPF "lost+found"
int main (int argc, char ** argv)
{
- char name [EXT2_NAME_LEN];
- char path [sizeof (LPF) + 1 + 256];
+ char name[EXT2_NAME_LEN + 2];
+ char path[sizeof (LPF) + 1 + 256];
struct stat st;
int i, j;
int d;
E2FSPROGS_DATE);
if (argc != 1) {
(void)argv; /* avoid unused argument warning */
- fprintf (stderr, _("Usage: mklost+found\n"));
+ fprintf (stderr, "%s", _("Usage: mklost+found\n"));
exit(1);
}
if (mkdir (LPF, 0700) == -1) {
perror ("mkdir");
exit(1);
}
-
+
i = 0;
- memset (name, 'x', 252);
+ memset (name, 'x', 246);
do {
- sprintf (name + 252, "%02d", i);
+ sprintf (name + 246, "%08d", i);
strcpy (path, LPF);
strcat (path, "/");
strcat (path, name);
}
} while (st.st_size <= (EXT2_NDIR_BLOCKS - 1) * st.st_blksize);
for (j = 0; j < i; j++) {
- sprintf (name + 252, "%02d", j);
+ sprintf (name + 246, "%08d", j);
strcpy (path, LPF);
strcat (path, "/");
strcat (path, name);