aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--findutils/which.c2
-rw-r--r--which.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/findutils/which.c b/findutils/which.c
index 1d7524465..08813c149 100644
--- a/findutils/which.c
+++ b/findutils/which.c
@@ -53,7 +53,7 @@ extern int which_main(int argc, char **argv)
argv++;
found = 0;
for (i = 0; i < count; i++) {
- char buf[strlen(path_n)+1+strlen(*argv)];
+ char buf[strlen(path_n)+strlen(*argv)+2];
strcpy (buf, path_n);
strcat (buf, "/");
strcat (buf, *argv);
diff --git a/which.c b/which.c
index 1d7524465..08813c149 100644
--- a/which.c
+++ b/which.c
@@ -53,7 +53,7 @@ extern int which_main(int argc, char **argv)
argv++;
found = 0;
for (i = 0; i < count; i++) {
- char buf[strlen(path_n)+1+strlen(*argv)];
+ char buf[strlen(path_n)+strlen(*argv)+2];
strcpy (buf, path_n);
strcat (buf, "/");
strcat (buf, *argv);