summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-03 16:31:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-16 18:42:57 +0100
commit270e41adb0c7a5f3e25e0ea25933de0d5c32ef9c (patch)
treed56df4efd8e9345cf7f213e6149b9a71a49da458 /svl
parent26caf1bc59c81704f11225e3e431e412deb8c475 (diff)
loplugin:buriedassign in sd..writerfilter
Change-Id: I954c12d9e1c493be6ac8c7b15076077b5bff5b74 Reviewed-on: https://gerrit.libreoffice.org/62811 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/crypto/cryptosign.cxx8
-rw-r--r--svl/source/numbers/zforfind.cxx14
2 files changed, 17 insertions, 5 deletions
diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx
index ea2813be4202..9f18e53a3eca 100644
--- a/svl/source/crypto/cryptosign.cxx
+++ b/svl/source/crypto/cryptosign.cxx
@@ -474,8 +474,9 @@ bad_data:
} while (len > 0);
/* now result contains result_bytes of data */
if (to->data && to->len >= result_bytes) {
- PORT_Memcpy(to->data, result, to->len = result_bytes);
- rv = SECSuccess;
+ to->len = result_bytes;
+ PORT_Memcpy(to->data, result, to->len);
+ rv = SECSuccess;
} else {
SECItem result_item = {siBuffer, nullptr, 0 };
result_item.data = result;
@@ -1855,7 +1856,8 @@ bad_data:
/* now result contains result_bytes of data */
if (to->data && to->len >= result_bytes)
{
- PORT_Memcpy(to->data, result, to->len = result_bytes);
+ to->len = result_bytes;
+ PORT_Memcpy(to->data, result, to->len);
rv = SECSuccess;
}
else
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 63ae92c13608..0ec1cd812418 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1170,8 +1170,18 @@ bool ImpSvNumberInputScan::MayBeMonthDate()
bool bYear1 = (sStrArray[nNums[0]].getLength() >= 3);
bool bYear2 = (sStrArray[nNums[1]].getLength() >= 3);
sal_Int32 n;
- bool bDay1 = (!bYear1 && (n = sStrArray[nNums[0]].toInt32()) >= 1 && n <= 31);
- bool bDay2 = (!bYear2 && (n = sStrArray[nNums[1]].toInt32()) >= 1 && n <= 31);
+ bool bDay1 = !bYear1;
+ if (bDay1)
+ {
+ n = sStrArray[nNums[0]].toInt32();
+ bDay1 = n >= 1 && n <= 31;
+ }
+ bool bDay2 = !bYear2;
+ if (bDay2)
+ {
+ n = sStrArray[nNums[1]].toInt32();
+ bDay2 = n >= 1 && n <= 31;
+ }
if (bDay1 && !bDay2)
{