Skip to content
Snippets Groups Projects
Commit cdd8798c authored by Mark Grondona's avatar Mark Grondona
Browse files

o bugfixes

parent 4f4eaaef
No related branches found
No related tags found
No related merge requests found
......@@ -48,18 +48,15 @@ setenvpf(char ***envp, int *envc, const char *fmt, ...)
{
va_list ap;
char buf[BUFSIZ];
char *bufcpy;
char **env = *envp;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
xrealloc(*env, (*envc+1)*sizeof(char *));
bufcpy = xstrdup(buf);
env[(*envc)++] = bufcpy;
env[*envc] = NULL;
xrealloc(env, (*envc+2)*sizeof(char *));
env[(*envc)++] = xstrdup(buf);
env[(*envc)] = NULL;
*envp = env;
return *envc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment