From: Todd C. Miller Date: Wed, 28 Mar 2012 14:58:02 +0000 (-0400) Subject: Quiet a compiler warning on systems where the argument to putenv(3) X-Git-Tag: SUDO_1_8_5~1^2~109 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8251a07745f0301d0c99dbc3a6fa62ea5d1c751;p=sudo Quiet a compiler warning on systems where the argument to putenv(3) is const. --- diff --git a/src/env_hooks.c b/src/env_hooks.c index c31b5e6c6..1dcef3dce 100644 --- a/src/env_hooks.c +++ b/src/env_hooks.c @@ -101,7 +101,7 @@ rpl_putenv(PUTENV_CONST char *string) len = (strchr(string, '=') - string) + 1; for (ep = environ; *ep != NULL; ep++) { if (strncmp(string, *ep, len) == 0) { - *ep = string; + *ep = (char *)string; found = true; break; } @@ -125,7 +125,7 @@ rpl_putenv(PUTENV_CONST char *string) char **envp = erealloc3(priv_environ, env_len + 2, sizeof(char *)); if (environ != priv_environ) memcpy(envp, environ, env_len * sizeof(char *)); - envp[env_len++] = string; + envp[env_len++] = (char *)string; envp[env_len] = NULL; priv_environ = environ = envp; }