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 --- fpicker/source/aqua/NSString_OOoAdditions.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/aqua/NSString_OOoAdditions.mm b/fpicker/source/aqua/NSString_OOoAdditions.mm index 23ae6bc5c853..5721674f8121 100644 --- a/fpicker/source/aqua/NSString_OOoAdditions.mm +++ b/fpicker/source/aqua/NSString_OOoAdditions.mm @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include + #include "NSString_OOoAdditions.hxx" @implementation NSString (OOoAdditions) @@ -32,14 +36,14 @@ { unsigned int nFileNameLength = [self length]; - UniChar unichars[nFileNameLength+1]; + auto const unichars = std::make_unique(nFileNameLength+1); //'close' the string buffer correctly unichars[nFileNameLength] = '\0'; - [self getCharacters:unichars]; + [self getCharacters:unichars.get()]; - return OUString(reinterpret_cast(unichars)); + return OUString(reinterpret_cast(unichars.get())); } @end -- cgit