Patch from Alexander Gerasiov <gq@debian.org>
for (; optind < argc; optind++)
{
const char *input_name;
- char output_name[200]; /* FIXME: dangerous limit */
+ char *output_name;
FILE *file;
struct stat file_stat;
struct utimbuf file_utime;
input_name = argv[optind];
+ output_name = xmalloc (strlen (input_name) + 17 + 1); /* 17 is upper limit for rec%d.tmp where %d is pid_t */
/* Check if the file can be read and rewritten. */
unlink (output_name);
}
+ free (output_name);
}
}
else