From: Russell Bryant Date: Sun, 19 Mar 2006 21:40:42 +0000 (+0000) Subject: fix the build of eagi-test on Solaris in combination with astmm X-Git-Tag: 1.4.0-beta1~2389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=419bc78aa34d4b832f54e5217120e5829e445634;p=thirdparty%2Fasterisk.git fix the build of eagi-test on Solaris in combination with astmm git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@13630 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/agi/Makefile b/agi/Makefile index a2f3bee057..e245877207 100644 --- a/agi/Makefile +++ b/agi/Makefile @@ -13,7 +13,7 @@ AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi -CFLAGS+= +CFLAGS+=-DNO_AST_MM LIBS= ifeq ($(OSARCH),SunOS) diff --git a/strcompat.c b/strcompat.c index 8c9916d23b..93a6b0c2b4 100644 --- a/strcompat.c +++ b/strcompat.c @@ -33,21 +33,18 @@ char* strsep(char** str, const char* delims) int setenv(const char *name, const char *value, int overwrite) { unsigned char *buf; - int buflen, ret; + int buflen; buflen = strlen(name) + strlen(value) + 2; - if ((buf = malloc(buflen)) == NULL) + if (!(buf = alloca(buflen))) return -1; if (!overwrite && getenv(name)) return 0; snprintf(buf, buflen, "%s=%s", name, value); - ret = putenv(buf); - free(buf); - - return ret; + return putenv(buf); } void unsetenv(const char *name)