From 85966810131b1db3fe0cdc0c54b08703350abf39 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Sep 2018 16:20:44 +0200 Subject: clang-tidy bugprone-sizeof-expression this was not really testing anything before, because it was doing sizeof(char*) which is 4 or 8 Change-Id: I7eccdd3c6ae14a6fabb27202737fdb2fd12663dc Reviewed-on: https://gerrit.libreoffice.org/60182 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sal/qa/rtl/alloc/rtl_alloc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sal/qa') diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx index 0e9b7c0f47a8..f59d78f9fa6c 100644 --- a/sal/qa/rtl/alloc/rtl_alloc.cxx +++ b/sal/qa/rtl/alloc/rtl_alloc.cxx @@ -155,7 +155,7 @@ public: void test() { - const char *sample = "Hello World"; + const char sample[] = "Hello World"; std::vector aStrings; rtl_alloc_preInit(true); @@ -168,7 +168,7 @@ public: for (int i = 1; i < 4096; i += 8) { OUStringBuffer aBuf(i); - aBuf.appendAscii(sample, (i/8) % (sizeof(sample)-1)); + aBuf.appendAscii(sample, (i/8) % (SAL_N_ELEMENTS(sample)-1)); OUString aStr = aBuf.makeStringAndClear(); aStrings.push_back(aStr); } -- cgit