]> granicus.if.org Git - sudo/commitdiff
Quiet a compiler warning on systems where the argument to putenv(3)
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 28 Mar 2012 14:58:02 +0000 (10:58 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 28 Mar 2012 14:58:02 +0000 (10:58 -0400)
is const.

src/env_hooks.c

index c31b5e6c6a8b07f30a54e0fd257f8d78ac53eaf5..1dcef3dce6a9dc5244b0f8534858e351d2d3b4fb 100644 (file)
@@ -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;
     }