From: Tomas Mraz Date: Thu, 6 Jun 2013 18:13:26 +0000 (+0200) Subject: Do not use putenv with string literal. X-Git-Tag: cronie1.4.11~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ac31751adfa31c5e5e316afc2f800037bd1cdca;p=cronie Do not use putenv with string literal. --- diff --git a/src/cron.c b/src/cron.c index 9974887..08d0812 100644 --- a/src/cron.c +++ b/src/cron.c @@ -244,8 +244,8 @@ int main(int argc, char *argv[]) { check_spool_dir(); if (ChangePath) { - if (putenv("PATH=" _PATH_DEFPATH) < 0) { - log_it("CRON", pid, "DEATH", "can't putenv PATH", + if (setenv("PATH", _PATH_DEFPATH) < 0) { + log_it("CRON", pid, "DEATH", "can't setenv PATH", errno); exit(1); }