diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/backends/macbe/macbackend.mm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm index e84ecd4b8013..7733bf95da6c 100644 --- a/shell/source/backends/macbe/macbackend.mm +++ b/shell/source/backends/macbe/macbackend.mm @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <memory> // For MAXHOSTNAMELEN constant #include <sys/param.h> @@ -157,13 +160,13 @@ static OUString CFStringToOUString(const CFStringRef sOrig) { CFIndex nStringLen = CFStringGetLength(sOrig)+1; // Allocate a c string buffer - char sBuffer[nStringLen]; + auto const sBuffer = std::make_unique<char[]>(nStringLen); - CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII); + CFStringGetCString(sOrig, sBuffer.get(), nStringLen, kCFStringEncodingASCII); CFRelease(sOrig); - return OUString::createFromAscii(sBuffer); + return OUString::createFromAscii(sBuffer.get()); } static OUString GetOUString( NSString* pStr ) |