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

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


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep  7 21:04:22 2013 +0200| [7aa02edf9d4a6807320a599175da6d7f0197de4e] | 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=7aa02edf9d4a6807320a599175da6d7f0197de4e
---

 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