aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--name.c4
-rw-r--r--re.114
2 files changed, 13 insertions, 5 deletions
diff --git a/name.c b/name.c
index e9c13d7..a98c051 100644
--- a/name.c
+++ b/name.c
@@ -64,13 +64,13 @@ usage: fprintf(stderr, "usage: %s [-x]\n", name);
err(1, "fopen");
/* Read original file names. */
- for (i = 0; fgets(tmp, MAXLINE, fp); i++) {
+ for (i = 0; i < MAXFILES && fgets(tmp, MAXLINE, fp); i++) {
tmp[strcspn(tmp, "\n")] = 0;
strcpy(froms[i], tmp);
}
/* Read new file names. */
- for (j = 0; fgets(tmp, MAXLINE, stdin); j++) {
+ for (j = 0; j < MAXFILES && fgets(tmp, MAXLINE, stdin); j++) {
tmp[strcspn(tmp, "\n")] = 0;
strcpy(tos[j], tmp);
}
diff --git a/re.1 b/re.1
index 1bb1ae0..5e0d93d 100644
--- a/re.1
+++ b/re.1
@@ -69,10 +69,18 @@ are written by John Ankarström
.Sh BUGS
.Pp
.Nm re
-and
+does not support file names containing newlines
+and will exit with an error if provided with such file names.
+.Pp
.Nm name
-do not support file names containing newlines
-and will exit if provided with such file names.
+uses hard-coded array sizes:
+at most, one hundred 255-character file names can be processed.
+While overflows are correctly handled,
+they are silently ignored.
+When processing very many or very long file names,
+the use of the
+.Fl x
+flag is not recommended.
.Pp
The temporary file is placed at
.Pa /var/tmp/re.$PPID ,