]> git.sesse.net Git - vlc/commitdiff
Win32 vlc.exe: simplify by not calling asprintf
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 7 Sep 2013 19:04:22 +0000 (21:04 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 7 Sep 2013 19:14:40 +0000 (21:14 +0200)
Suggestion from funman

bin/winvlc.c

index 22258b0abe9a9044c03e0737cae270de6d76881a..837c585b62ed6f056cc14bebc710334535afdf8a 100644 (file)
@@ -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);