diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-05-22 13:49:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-05-22 16:35:20 +0200 |
commit | c18e2ea2a52fc171c50fcb22d431e94c6aececc5 (patch) | |
tree | a63721b18626947e5278a51feb7fd64604e80eee /comphelper | |
parent | 7cf4bcef41448218f76fa1e974f541e13dc03023 (diff) |
New loplugin:data
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data
to &vector[0]"
Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01
Reviewed-on: https://gerrit.libreoffice.org/72765
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/backupfilehelper.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/xml/xmltools.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index 4c7917e96015..aa81039ad89c 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -158,9 +158,9 @@ namespace sal_uInt64 nBaseRead(0); // read rTarget - if (osl::File::E_None == rFile->read(static_cast<void*>(&aTarget[0]), nLength, nBaseRead) && nLength == nBaseRead) + if (osl::File::E_None == rFile->read(static_cast<void*>(aTarget.data()), nLength, nBaseRead) && nLength == nBaseRead) { - rTarget = OString(&aTarget[0], static_cast< sal_Int32 >(nLength)); + rTarget = OString(aTarget.data(), static_cast< sal_Int32 >(nLength)); return true; } diff --git a/comphelper/source/xml/xmltools.cxx b/comphelper/source/xml/xmltools.cxx index 24919ae35044..c8f8863a4db9 100644 --- a/comphelper/source/xml/xmltools.cxx +++ b/comphelper/source/xml/xmltools.cxx @@ -83,13 +83,13 @@ namespace comphelper sal_Int32 nLength = 1024+n; // coverity[tainted_data] - 1024 deliberate random minus max -127/plus max 128 std::vector<sal_uInt8> aChaff(nLength); - rtl_random_getBytes(pool, &aChaff[0], nLength); + rtl_random_getBytes(pool, aChaff.data(), nLength); rtl_random_destroyPool(pool); encodeChaff(aChaff); - return OString(reinterpret_cast<const sal_Char*>(&aChaff[0]), nLength); + return OString(reinterpret_cast<const sal_Char*>(aChaff.data()), nLength); } OString generateGUIDString() |