diff options
-rw-r--r-- | support/popthelp.c | 4 | ||||
-rw-r--r-- | support/poptparse.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/support/popthelp.c b/support/popthelp.c index 0e2f43a3..618f8a21 100644 --- a/support/popthelp.c +++ b/support/popthelp.c @@ -13,6 +13,10 @@ #include <stdlib.h> #include <string.h> +#ifdef HAVE_ALLOCA_H +#include <alloca.h> +#endif + #include "popt-gnome.h" #include "poptint.h" diff --git a/support/poptparse.c b/support/poptparse.c index d0838241..35eaa436 100644 --- a/support/poptparse.c +++ b/support/poptparse.c @@ -9,11 +9,14 @@ #include <ctype.h> #include <stdlib.h> #include <string.h> +#ifdef HAVE_ALLOCA_H +#include <alloca.h> +#endif #include "popt-gnome.h" int poptParseArgvString(char * s, int * argcPtr, char *** argvPtr) { - char * buf = strcpy(alloca(strlen(s) + 1), s); + char * buf; char * bufStart = buf; char * src, * dst; char quote = '\0'; @@ -23,6 +26,7 @@ int poptParseArgvString(char * s, int * argcPtr, char *** argvPtr) { int argc = 0; int i; + buf = strcpy(alloca(strlen(s) + 1), s); src = s; dst = buf; argv[argc] = buf; |