From 85d9078be0456de8014a6f186f3916ddb01792d2 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 30 Sep 2011 14:28:00 +0200 Subject: [PATCH] Don't use PATH_MAX unless its defined * Fixes build on GNU/Hurd https://bugs.freedesktop.org/show_bug.cgi?id=41303 --- p11-kit/modules.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/p11-kit/modules.c b/p11-kit/modules.c index 4c87cee..c0a000a 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -263,9 +263,14 @@ build_path (const char *dir, const char *filename) assert (filename); len = snprintf (NULL, 0, "%s/%s", dir, filename) + 1; - if (len <= 0 || len > PATH_MAX) + if (len <= 0) return NULL; +#ifdef PATH_MAX + if (len > PATH_MAX) + return NULL; +#endif + if (!(path = malloc (len))) return NULL; -- 2.40.0