Fix variable length array declaration.
This commit is contained in:
parent
5eb0440110
commit
e764ff7be9
1 changed files with 2 additions and 2 deletions
|
|
@ -356,7 +356,7 @@ bool detach(void) {
|
||||||
bool execute_script(const char *name, char **envp) {
|
bool execute_script(const char *name, char **envp) {
|
||||||
#ifdef HAVE_SYSTEM
|
#ifdef HAVE_SYSTEM
|
||||||
int status, len;
|
int status, len;
|
||||||
char *scriptname, *p;
|
char *scriptname;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#ifndef HAVE_MINGW
|
#ifndef HAVE_MINGW
|
||||||
|
|
@ -397,7 +397,7 @@ bool execute_script(const char *name, char **envp) {
|
||||||
for(i = 0; envp[i]; i++) {
|
for(i = 0; envp[i]; i++) {
|
||||||
char *e = strchr(envp[i], '=');
|
char *e = strchr(envp[i], '=');
|
||||||
if(e) {
|
if(e) {
|
||||||
p[e - envp[i] + 1];
|
char p[e - envp[i] + 1];
|
||||||
strncpy(p, envp[i], e - envp[i]);
|
strncpy(p, envp[i], e - envp[i]);
|
||||||
p[e - envp[i]] = '\0';
|
p[e - envp[i]] = '\0';
|
||||||
putenv(p);
|
putenv(p);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue