X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfcgi.c;h=aa86e4938df91c263d284a7f9bacc7a98289f49c;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=fec09e3c4cf16a3600d6f691dab9c84e11797498;hpb=8526dcf3a698c688e2cc4430ae106b5ecf70677f;p=swftools.git diff --git a/lib/modules/swfcgi.c b/lib/modules/swfcgi.c index fec09e3..aa86e49 100644 --- a/lib/modules/swfcgi.c +++ b/lib/modules/swfcgi.c @@ -23,6 +23,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include +#include "../rfxswf.h" #define ishex(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'a' && (x) <= 'f') || ((x) >= 'A' && (x) <= 'F')) @@ -69,15 +72,15 @@ static void swf_cgienv(unsigned char * var) // fprintf(stderr,"%s\n",var); - buf = (unsigned char*)rfx_alloc(strlen(var) + sizeof(PREFIX) + 2); + buf = (unsigned char*)rfx_alloc(strlen((const char*)var) + sizeof(PREFIX) + 2); if (!buf) return; - strcpy(buf, PREFIX); + strcpy((char*)buf, (const char*)PREFIX); if (var[0] == '_') - { strcpy(&buf[sizeof(PREFIX)-1], &var[1]); + { strcpy((char*)&buf[sizeof(PREFIX)-1], (const char*)&var[1]); despace = 1; } - else strcpy(&buf[sizeof(PREFIX)-1], var); + else strcpy((char*)&buf[sizeof(PREFIX)-1], (const char*)var); for (c = buf; c[0] ; c++) { if (c[0] == '.') c[0] = '_'; @@ -106,22 +109,22 @@ static void swf_cgienv(unsigned char * var) t[1] = 0; } - if ((oldval = getenv(buf))) - { newval = (unsigned char*)rfx_alloc(strlen(oldval) + strlen(buf) + strlen(&c[1]) + 3); + if ((oldval = (unsigned char*)getenv((const char*)buf))) + { newval = (unsigned char*)rfx_alloc(strlen((const char*)oldval) + strlen((const char *)buf) + strlen((const char*)&c[1]) + 3); if (!newval) return; c[0] = '='; - sprintf(newval, "%s#%s", buf, oldval); + sprintf((char*)newval, "%s#%s", buf, oldval); c[0] = 0; - oldval -= strlen(buf) + 1; // skip past VAR= + oldval -= strlen((const char*)buf) + 1; // skip past VAR= } else { c[0] = '='; newval = buf; } - putenv(newval); + putenv((char *)newval); if (oldval) { rfx_free(oldval); @@ -136,7 +139,7 @@ static void swf_scanquery(char * q) while (next) { next = strchr(q, '&'); if (next) next[0] = 0; - swf_cgienv(q); + swf_cgienv((unsigned char*)q); if (next) { next[0] = '&'; q = next+1; @@ -155,7 +158,7 @@ char * swf_postread() if (!buf) return NULL; size = atoi(buf); - buf = (unsigned char*)rfx_alloc(size + 1); + buf = (char*)rfx_alloc(size + 1); if (buf) { do { got = fread(buf + sofar, 1, size - sofar, stdin);