From 8d21fee22ec79324eef6e9a88c83bd6cf32315d6 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Mon, 13 Dec 2021 16:56:48 +0000 Subject: remove a couple hundred sys/param.h includes in userland code, and also whack some sys/cdefs.h early includes which is such a brutally bad pattern ok bluhm mbuhl --- src/regress/lib/libc/basename/basename_test.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/regress/lib/libc/basename') diff --git a/src/regress/lib/libc/basename/basename_test.c b/src/regress/lib/libc/basename/basename_test.c index 34e138c726..7272c46b1d 100644 --- a/src/regress/lib/libc/basename/basename_test.c +++ b/src/regress/lib/libc/basename/basename_test.c @@ -4,8 +4,6 @@ * Public domain. */ -#include - #include #include #include @@ -15,7 +13,7 @@ int main(void) { - char path[2 * MAXPATHLEN]; + char path[2 * PATH_MAX]; const char *dir = "junk/"; const char *fname = "file.name.ext"; char *str; @@ -35,7 +33,7 @@ main(void) * 1) path is NULL * 2) path is the empty string * 3) path is composed entirely of slashes - * 4) the resulting name is larger than MAXPATHLEN + * 4) the resulting name is larger than PATH_MAX * * The first two cases require that a pointer * to the string "." be returned. @@ -58,7 +56,7 @@ main(void) goto fail; /* Case 3 */ - for (i = 0; i < MAXPATHLEN - 1; i++) + for (i = 0; i < PATH_MAX - 1; i++) strlcat(path, "/", sizeof(path)); /* path cleared above */ str = basename(path); if (strcmp(str, "/") != 0) @@ -67,7 +65,7 @@ main(void) /* Case 4 */ strlcpy(path, "/", sizeof(path)); strlcat(path, dir, sizeof(path)); - for (i = 0; i <= MAXPATHLEN; i += sizeof(fname)) + for (i = 0; i <= PATH_MAX; i += sizeof(fname)) strlcat(path, fname, sizeof(path)); str = basename(path); if (str != NULL || errno != ENAMETOOLONG) -- cgit v1.2.3-55-g6feb