diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-03-28 16:31:04 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-03-29 10:15:29 +0000 |
commit | b5b25b5904027a589010ab4cfbddac042ac01eb4 (patch) | |
tree | bdda3638a72f7e3cf7d0e108935f2931e7b78b6c | |
parent | Fix realloc mistake for DrawImage (diff) | |
download | w3m-b5b25b5904027a589010ab4cfbddac042ac01eb4.tar.gz w3m-b5b25b5904027a589010ab4cfbddac042ac01eb4.zip |
Fix uninitialized variable when not HAVE_PUTENV
Diffstat (limited to '')
-rw-r--r-- | local.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -213,18 +213,17 @@ set_environ(char *var, char *value) if (var != NULL && value != NULL) setenv(var, value, 1); #else /* not HAVE_SETENV */ -#ifdef HAVE_PUTENV static Hash_sv *env_hash = NULL; Str tmp = Strnew_m_charp(var, "=", value, NULL); if (env_hash == NULL) env_hash = newHash_sv(20); putHash_sv(env_hash, var, (void *)tmp->ptr); +#ifdef HAVE_PUTENV putenv(tmp->ptr); #else /* not HAVE_PUTENV */ extern char **environ; char **ne; - char *p; int i, l, el; char **e, **newenv; @@ -251,7 +250,7 @@ set_environ(char *var, char *value) if (newenv == NULL) return; for (e = environ, ne = newenv; *e != NULL; *(ne++) = *(e++)) ; - *(ne++) = p; + *(ne++) = tmp->ptr; *ne = NULL; environ = newenv; #endif /* not HAVE_PUTENV */ |