From 71fefd86ac7e2328ad11a8a3a49452a2e65b186b Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 31 May 2009 13:00:51 +0000 Subject: 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 --- osdep/getch2-os2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'osdep/getch2-os2.c') 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 #include +#include #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 -- cgit v1.2.3