[Scummvm-cvs-logs] scummvm master -> 7af36e97243ed1e94f8f7b75618aad979165e68c
clone2727
clone2727 at gmail.com
Sun Jun 1 23:04:05 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7af36e9724 BACKENDS: Fix invalid buffer size in CFStringGetCString call
Commit: 7af36e97243ed1e94f8f7b75618aad979165e68c
https://github.com/scummvm/scummvm/commit/7af36e97243ed1e94f8f7b75618aad979165e68c
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2014-06-01T17:02:18-04:00
Commit Message:
BACKENDS: Fix invalid buffer size in CFStringGetCString call
Changed paths:
backends/platform/sdl/macosx/macosx.cpp
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 924e33b..c48076c 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;
}
More information about the Scummvm-git-logs
mailing list