summaryrefslogtreecommitdiff
path: root/support/popt.c
diff options
context:
space:
mode:
authorErik Troan <ewt@src.gnome.org>1998-03-04 16:51:54 +0000
committerErik Troan <ewt@src.gnome.org>1998-03-04 16:51:54 +0000
commit93c9733fdb7eff4936368c9acee7666c9e2bd1b9 (patch)
tree651dab7c3f81a3a6f037e5994fc6ff95861bf96f /support/popt.c
parent1c9965838d00c3ba9e5a0ed6659ee5b27f787cc2 (diff)
downloadgnome-common-93c9733fdb7eff4936368c9acee7666c9e2bd1b9.tar.gz
include alloca.h if present
svn path=/trunk/; revision=108
Diffstat (limited to 'support/popt.c')
-rw-r--r--support/popt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/support/popt.c b/support/popt.c
index 8029d60..2afffb9 100644
--- a/support/popt.c
+++ b/support/popt.c
@@ -8,6 +8,10 @@
#include <sys/mman.h>
#include <unistd.h>
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
+
#include "popt.h"
struct optionStackEntry {
@@ -389,7 +393,8 @@ int poptParseArgvString(char * s, int * argcPtr, char *** argvPtr) {
argc++, buf++;
}
- argv2 = (void * )dst = malloc(argc * sizeof(*argv) + (buf - bufStart));
+ dst = malloc(argc * sizeof(*argv) + (buf - bufStart));
+ argv2 = (void *) dst;
dst += argc * sizeof(*argv);
memcpy(argv2, argv, argc * sizeof(*argv));
memcpy(dst, bufStart, buf - bufStart);