From 7af36e97243ed1e94f8f7b75618aad979165e68c Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 1 Jun 2014 17:01:57 -0400 Subject: BACKENDS: Fix invalid buffer size in CFStringGetCString call --- backends/platform/sdl/macosx/macosx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp index 924e33b6e3..c48076c42f 100644 --- a/backends/platform/sdl/macosx/macosx.cpp +++ b/backends/platform/sdl/macosx/macosx.cpp @@ -145,7 +145,7 @@ Common::String OSystem_MacOSX::getSystemLanguage() const { for (CFIndex i = 0 ; i < localizationsSize ; ++i) { CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(preferredLocalizations, i); char buffer[10]; - CFStringGetCString(language, buffer, 50, kCFStringEncodingASCII); + CFStringGetCString(language, buffer, sizeof(buffer), kCFStringEncodingASCII); int32 languageId = TransMan.findMatchingLanguage(buffer); if (languageId != -1) { CFRelease(preferredLocalizations); @@ -156,7 +156,7 @@ Common::String OSystem_MacOSX::getSystemLanguage() const { if (localizationsSize > 0) { CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(preferredLocalizations, 0); char buffer[10]; - CFStringGetCString(language, buffer, 50, kCFStringEncodingASCII); + CFStringGetCString(language, buffer, sizeof(buffer), kCFStringEncodingASCII); CFRelease(preferredLocalizations); return buffer; } -- cgit v1.2.3