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

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


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

Win32 vlc.exe: simplify by not calling asprintf

Suggestion from funman

(cherry picked from commit c435b2e5c6305af567bbe0e6a276c2634d82042e)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

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

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 22258b0..837c585 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -164,11 +164,9 @@ 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(lang);
 



More information about the vlc-commits mailing list