summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-07 16:20:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-08 14:45:22 +0200
commit85966810131b1db3fe0cdc0c54b08703350abf39 (patch)
tree0140800ebb0054e08f652a57148ca425b1fcb53c /sal/qa
parent2002bbe83de99784e38edc206f83c580e2a7a7a7 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/rtl/alloc/rtl_alloc.cxx4
1 files changed, 2 insertions, 2 deletions
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<OUString> 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);
}