Use variable length arrays instead of alloca().

This commit is contained in:
Guus Sliepen 2010-11-13 15:55:38 +01:00
parent e2e6ec8050
commit 9e3ca39773
3 changed files with 6 additions and 13 deletions

View file

@ -397,7 +397,7 @@ bool execute_script(const char *name, char **envp) {
for(i = 0; envp[i]; i++) {
char *e = strchr(envp[i], '=');
if(e) {
p = alloca(e - envp[i] + 1);
p[e - envp[i] + 1];
strncpy(p, envp[i], e - envp[i]);
p[e - envp[i]] = '\0';
putenv(p);