Use variable length arrays instead of alloca().
This commit is contained in:
parent
e2e6ec8050
commit
9e3ca39773
3 changed files with 6 additions and 13 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue