[vlc-commits] Win32 vlc.exe: simplify by not calling asprintf

Jean-Baptiste Kempf git at videolan.org
Sat Sep 7 21:04:53 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep  7 21:04:22 2013 +0200| [f817628f93cefbe7dde082352a8c46d522d8e05b] | committer: Jean-Baptiste Kempf

Win32 vlc.exe: simplify by not calling asprintf

Suggestion from funman

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

 bin/winvlc.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 22258b0..aca886e 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -164,11 +164,10 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
 
     if (lang && strncmp( lang, "auto", 4 ) )
     {
-        char *tmp;
-        if (asprintf(&tmp, "LANG=%s", lang) != -1 ) {
-            putenv(tmp);
-            free(tmp);
-        }
+        char tmp[11];
+        snprintf(tmp, 11, "LANG=%s", lang);
+        putenv(tmp);
+        free(tmp);
     }
     free(lang);
 



More information about the vlc-commits mailing list