From f029f8dfb05fbbe2d698fe3411cd37f8ae7a02a2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 27 Oct 2023 13:44:27 +0200 Subject: Various -Werror,-Wvla-cxx-extension ...as enabled by default now in recent Clang 18 trunk Change-Id: I59f9bbdf2ce064f170df01e6d7ec2341884ab5e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158563 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- shell/source/backends/macbe/macbackend.mm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'shell/source') 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 + +#include // For MAXHOSTNAMELEN constant #include @@ -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(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 ) -- cgit