#ifndef HAVE_SETENV
int setenv(const char *name, const char *value, int overwrite) {
- static char *buffer= 0;
- static int avail= 0;
-
- int r;
+ char *buffer= 0;
assert(overwrite==1);
- r= makeroom(&buffer,&avail,strlen(name)+strlen(value)+2);
- if (r) { errno= EINVAL; return -1; }
+ buffer= xmalloc(strlen(name)+strlen(value)+2);
sprintf(buffer,"%s=%s",name,value);
return putenv(buffer);