diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 02:56:01 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 02:56:01 +0300 |
commit | a2037a2effbd4622d0e8336245a9b14c3f886bde (patch) | |
tree | bd2face6dd36d2663197b23a33da9e9b2814f70c /osdep | |
parent | 0c2773a709276681575d2507aa60ee85c2d0b850 (diff) | |
parent | 43079c51daa8c12b0a44e5ad8022c979dd9e8336 (diff) | |
download | mpv-a2037a2effbd4622d0e8336245a9b14c3f886bde.tar.bz2 mpv-a2037a2effbd4622d0e8336245a9b14c3f886bde.tar.xz |
Merge svn changes up to r29412
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/getch2-os2.c | 3 | ||||
-rw-r--r-- | osdep/getch2-win.c | 7 | ||||
-rw-r--r-- | osdep/getch2.c | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/osdep/getch2-os2.c b/osdep/getch2-os2.c index c470743e14..27ebfaa354 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" @@ -190,7 +191,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 diff --git a/osdep/getch2-win.c b/osdep/getch2-win.c index 1882bb419d..9dae9cd91d 100644 --- a/osdep/getch2-win.c +++ b/osdep/getch2-win.c @@ -25,6 +25,7 @@ #include "config.h" #include <stdio.h> +#include <string.h> #include <windows.h> #include "keycodes.h" #include "input/input.h" @@ -189,7 +190,7 @@ static const struct { char* get_term_charset(void) { - static char codepage[10]; + char codepage[10]; unsigned i, cpno = GetConsoleOutputCP(); if (!cpno) cpno = GetACP(); @@ -198,9 +199,9 @@ char* get_term_charset(void) for (i = 0; cp_alias[i].cp; i++) if (cpno == cp_alias[i].cp) - return cp_alias[i].alias; + return strdup(cp_alias[i].alias); snprintf(codepage, sizeof(codepage), "CP%u", cpno); - return codepage; + return strdup(codepage); } #endif diff --git a/osdep/getch2.c b/osdep/getch2.c index 3b680acd7f..4aa09323eb 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -298,7 +298,7 @@ char* get_term_charset(void) char* charset = NULL; #ifdef HAVE_LANGINFO setlocale(LC_CTYPE, ""); - charset = nl_langinfo(CODESET); + charset = strdup(nl_langinfo(CODESET)); setlocale(LC_CTYPE, "C"); #endif return charset; |