chiark / gitweb /
@@ -1,9 +1,11 @@
[userv.git] / lib.c
diff --git a/lib.c b/lib.c
index bd40ee08ab77376f74b1ce5715b9740a16c82e71..22c8cd1750a52af1855b242104191d6abb3028a1 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -116,14 +116,10 @@ void snytprintfcat(char *buffer, size_t size, const char *fmt, ...) {
 
 #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);