[vlc-commits] Win32 vlc.exe: simplify by not calling asprintf
Jean-Baptiste Kempf
git at videolan.org
Sat Sep 7 21:14:53 CEST 2013
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep 7 21:04:22 2013 +0200| [c435b2e5c6305af567bbe0e6a276c2634d82042e] | 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=c435b2e5c6305af567bbe0e6a276c2634d82042e
---
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