diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-27 13:44:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-27 22:12:07 +0200 |
commit | f029f8dfb05fbbe2d698fe3411cd37f8ae7a02a2 (patch) | |
tree | 08d1e78baaa0bbca64e8a499e331e694fa4c3c1d /shell/source | |
parent | 1d86a0b632813efb2259b795b272f8aa40a7c768 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'shell/source')
-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 ) |