commit e7ea3358ef627675fbd4669516617688a7e3dd94
parent a58c4b6b92c9036a25173c4e63d5235e1f9dcdae
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Sun, 20 Oct 2019 02:48:54 +0000
Don't rely on the existence of PATH_MAX
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/libstddjb/sarealpath.c b/src/libstddjb/sarealpath.c
@@ -1,7 +1,6 @@
/* ISC license. */
#include <string.h>
-#include <limits.h>
#include <stdlib.h>
#include <skalibs/stralloc.h>
#include <skalibs/djbunix.h>
@@ -10,7 +9,7 @@ int sarealpath (stralloc *sa, char const *path)
{
if (sa->s)
{
- if (!stralloc_readyplus(sa, PATH_MAX)) return -1 ;
+ if (!stralloc_readyplus(sa, 128)) return -1 ;
if (!realpath(path, sa->s + sa->len)) return -1 ;
sa->len += strlen(sa->s + sa->len) ;
}