summaryrefslogtreecommitdiffstats
path: root/osdep/getch2-os2.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-31 13:00:51 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-31 13:00:51 +0000
commit71fefd86ac7e2328ad11a8a3a49452a2e65b186b (patch)
treee0020c9481e406e4e4f0db4c9809c820ebe954a0 /osdep/getch2-os2.c
parent960285ea46a70897c3baa4f0f6a33893caacbb16 (diff)
downloadmpv-71fefd86ac7e2328ad11a8a3a49452a2e65b186b.tar.bz2
mpv-71fefd86ac7e2328ad11a8a3a49452a2e65b186b.tar.xz
Use a malloced string for the get_term_charset return value.
This is necessary at least on POSIX systems since the buffer returned by nl_langinfo may change its contents with e.g. each setlocale call. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29332 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'osdep/getch2-os2.c')
-rw-r--r--osdep/getch2-os2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/osdep/getch2-os2.c b/osdep/getch2-os2.c
index abb7f2e6ac..272d2d45e9 100644
--- a/osdep/getch2-os2.c
+++ b/osdep/getch2-os2.c
@@ -26,6 +26,7 @@
#include <os2.h>
#include <stdio.h>
+#include <string.h>
#include "config.h"
#include "keycodes.h"
@@ -189,7 +190,7 @@ char *get_term_charset( void )
#ifdef HAVE_LANGINFO
setlocale( LC_CTYPE, "");
- charset = nl_langinfo( CODESET );
+ charset = strdup( nl_langinfo( CODESET ));
setlocale( LC_CTYPE, "C");
#endif