diff options
author | Pino Toscano <pino@debian.org> | 2011-09-30 14:28:00 +0200 |
---|---|---|
committer | Stef Walter <stefw@collabora.co.uk> | 2011-09-30 14:28:00 +0200 |
commit | 85d9078be0456de8014a6f186f3916ddb01792d2 (patch) | |
tree | 4ac8c2de8c54bf1aa87f3762b5cd799c40fb2747 /p11-kit/modules.c | |
parent | 639aa9e38692ba5001987bb496e10cca14880807 (diff) |
Don't use PATH_MAX unless its defined
* Fixes build on GNU/Hurd
https://bugs.freedesktop.org/show_bug.cgi?id=41303
Diffstat (limited to 'p11-kit/modules.c')
-rw-r--r-- | p11-kit/modules.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |