[FFmpeg-cvslog] parseutils: replace setenv() by putenv().

Nicolas George git at videolan.org
Fri Apr 27 18:16:51 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Fri Apr 27 15:12:52 2012 +0200| [3e1d3ebf5e1ce96675a7ec692524b96a1aaed5dd] | committer: Nicolas George

parseutils: replace setenv() by putenv().

putenv() seems to be more portable.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e1d3ebf5e1ce96675a7ec692524b96a1aaed5dd
---

 libavutil/parseutils.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 037c4fb..de510ca 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -789,6 +789,7 @@ int main(void)
         int64_t tv;
         time_t tvi;
         struct tm *tm;
+        static char tzstr[] = "TZ=CET-1";
         const char *time_string[] = {
             "now",
             "12:35:46",
@@ -804,7 +805,7 @@ int main(void)
         };
 
         av_log_set_level(AV_LOG_DEBUG);
-        setenv("TZ", "CET-1", 1);
+        putenv(tzstr);
         printf("(now is 2012-03-17 09:14:13 +0100, local time is UTC+1)\n");
         for (i = 0;  i < FF_ARRAY_ELEMS(time_string); i++) {
             printf("%-24s -> ", time_string[i]);



More information about the ffmpeg-cvslog mailing list