[vlc-devel] commit: Prefer setenv to putenv (evenmore with local variables). ( Rémi Duraffort )

git version control git at videolan.org
Thu Jul 31 17:58:14 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jul 31 17:55:29 2008 +0200| [d632ffe1a6f5e6cea5dd796105e1708cdb0b3631]

Prefer setenv to putenv (evenmore with local variables).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d632ffe1a6f5e6cea5dd796105e1708cdb0b3631
---

 src/libvlc.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 17482f6..411ce92 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -1212,10 +1212,7 @@ static void SetLanguage ( const char *psz_lang )
      * the language at runtime under eg. Windows. Beware that this
      * makes the environment unconsistent when libvlc is unloaded and
      * should probably be moved to a safer place like vlc.c. */
-    static char psz_lcall[20];
-    snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
-    psz_lcall[19] = '\0';
-    putenv( psz_lcall );
+    setenv( "LC_ALL", psz_lang, 1 );
 #endif
 
     setlocale( LC_ALL, psz_lang );




More information about the vlc-devel mailing list