diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c index f55871a76efa..cea0ce676f2f 100644 --- a/usr.bin/which/which.c +++ b/usr.bin/which/which.c @@ -86,7 +86,7 @@ main(int argc, char **argv) while (argc > 0) { memcpy(path, p, pathlen); - if (strlen(*argv) > FILENAME_MAX || + if (strlen(*argv) >= FILENAME_MAX || print_matches(path, *argv) == -1) status = EXIT_FAILURE;