httpd: addEnv() brainstorming

Dirk Clemens develop at cle-mens.de
Mon Sep 5 11:57:40 UTC 2005


Here is an other recommendation for addEnv()

static void addEnv(const char *name_before_underline,
            const char *name_after_underline, const char *value)
{
  char buf[50]; // this is enough space for all names used in httpd

  if ( snprintf(buf,sizeof(buf), "%s%s%s=%s",
           name_before_underline,
           *name_after_underline ? "_" : "",
           name_after_underline ) >= 0
     ) setenv(buf, value ? value : "", 1 );
}





More information about the busybox mailing list