aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-03-06 16:14:58 +0000
committerJustus Winter <[email protected]>2017-03-06 17:10:08 +0000
commit9e29af900544fe4210a72cae87be78186d03e231 (patch)
tree06287ff88fa1cd771a39b005d945bb3bd2d8d6c0
parentgpgscm: Improve parsing. (diff)
downloadlibgpg-error-9e29af900544fe4210a72cae87be78186d03e231.tar.gz
libgpg-error-9e29af900544fe4210a72cae87be78186d03e231.zip
gpgscm: Fix creation of temporary directories.
* tests/gpgscm/ffi.c (do_mkdtemp): Use a larger buffer for the template. Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--ffi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ffi.c b/ffi.c
index 42facee..34e573f 100644
--- a/ffi.c
+++ b/ffi.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include <fcntl.h>
#include <gpg-error.h>
+#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
@@ -345,7 +346,11 @@ do_mkdtemp (scheme *sc, pointer args)
{
FFI_PROLOG ();
char *template;
- char buffer[128];
+#ifdef PATH_MAX
+ char buffer[PATH_MAX];
+#else
+ char buffer[1024];
+#endif
char *name;
FFI_ARG_OR_RETURN (sc, char *, template, string, args);
FFI_ARGS_DONE_OR_RETURN (sc, args);