提交 2de2f7dd 编写于 作者: S stooke

8203324: Use out of scope in getMacOSXLocale of java_props_macosx.c:120

Reviewed-by: shade, andrew
上级 11abfba6
......@@ -47,6 +47,8 @@ char *getPosixLocale(int cat) {
#define LOCALEIDLENGTH 128
char *getMacOSXLocale(int cat) {
const char* retVal = NULL;
char languageString[LOCALEIDLENGTH];
char localeString[LOCALEIDLENGTH];
switch (cat) {
case LC_MESSAGES:
......@@ -66,7 +68,6 @@ char *getMacOSXLocale(int cat) {
CFRelease(languages);
return NULL;
}
char languageString[LOCALEIDLENGTH];
if (CFStringGetCString(primaryLanguage, languageString,
LOCALEIDLENGTH, CFStringGetSystemEncoding()) == false) {
CFRelease(languages);
......@@ -81,7 +82,6 @@ char *getMacOSXLocale(int cat) {
// from Portuguese in Portugal), but this is missing when using the
// "Portuguese (Brazil)" language.
// If language is "pt" and the current locale is pt_BR, return pt_BR.
char localeString[LOCALEIDLENGTH];
if (strcmp(retVal, "pt") == 0 &&
CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()),
localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding()) &&
......@@ -92,7 +92,6 @@ char *getMacOSXLocale(int cat) {
break;
default:
{
char localeString[LOCALEIDLENGTH];
if (!CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()),
localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding())) {
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册