MAX* + 1 -> MAX*

This commit is contained in:
Todd C. Miller
1998-04-06 03:15:39 +00:00
parent 96d7c59702
commit c27d678ff7
5 changed files with 22 additions and 18 deletions

View File

@@ -94,7 +94,7 @@ extern char *strdup __P((const char *));
char * find_path(file)
char *file; /* file to find */
{
static char command[MAXPATHLEN + 1]; /* qualified filename */
static char command[MAXPATHLEN]; /* qualified filename */
register char *n; /* for traversing path */
char *path = NULL; /* contents of PATH env var */
char *origpath; /* so we can free path later */
@@ -105,7 +105,7 @@ char * find_path(file)
command[0] = '\0';
if (strlen(file) > MAXPATHLEN) {
if (strlen(file) >= MAXPATHLEN) {
errno = ENAMETOOLONG;
(void) fprintf(stderr, "%s: path too long: %s\n", Argv[0], file);
exit(1);