- * See the file COPYRIGHT for the respective terms and conditions.
- * If the file is missing contact me at lf@elemental.net
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
if ((p->env = malloc(size * sizeof(char *))) == NULL)
{
rc_log(LOG_CRIT, "rc_new_env: out of memory");
free(p);
return NULL;
if ((p->env = malloc(size * sizeof(char *))) == NULL)
{
rc_log(LOG_CRIT, "rc_new_env: out of memory");
free(p);
return NULL;
for (i = 0; env->env[i] != NULL; i++)
{
if (strncmp(env->env[i], name, MAX(strchr(env->env[i], '=') - env->env[i],strlen(name))) == 0)
for (i = 0; env->env[i] != NULL; i++)
{
if (strncmp(env->env[i], name, MAX(strchr(env->env[i], '=') - env->env[i],strlen(name))) == 0)
if ((env->env[env->size] = malloc(strlen(name)+strlen(value)+2)) == NULL) {
rc_log(LOG_CRIT, "rc_add_env: out of memory");
return (-1);
}
if ((env->env[env->size] = malloc(strlen(name)+strlen(value)+2)) == NULL) {
rc_log(LOG_CRIT, "rc_add_env: out of memory");
return (-1);
}
sprintf(env->env[env->size],"%s=%s", name, value);
sprintf(env->env[env->size],"%s=%s", name, value);