[vlc-commits] Win32 vlc.exe: simplify by not calling asprintf
Jean-Baptiste Kempf
git at videolan.org
Sat Sep 7 21:05:12 CEST 2013
vlc/vlc-2.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep 7 21:04:22 2013 +0200| [b62775b7d684202f3bfaa9bf9c3222f09bcc9093] | committer: Jean-Baptiste Kempf
Win32 vlc.exe: simplify by not calling asprintf
Suggestion from funman
(cherry picked from commit f817628f93cefbe7dde082352a8c46d522d8e05b)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=b62775b7d684202f3bfaa9bf9c3222f09bcc9093
---
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