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 /fpicker | |
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 'fpicker')
-rw-r--r-- | fpicker/source/aqua/NSString_OOoAdditions.mm | 10 |
1 files changed, 7 insertions, 3 deletions
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 <sal/config.h> + +#include <memory> + #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<UniChar[]>(nFileNameLength+1); //'close' the string buffer correctly unichars[nFileNameLength] = '\0'; - [self getCharacters:unichars]; + [self getCharacters:unichars.get()]; - return OUString(reinterpret_cast<sal_Unicode *>(unichars)); + return OUString(reinterpret_cast<sal_Unicode *>(unichars.get())); } @end |