diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-15 09:13:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-15 11:24:09 +0200 |
commit | 72d8f2961fd7f5670fe2564eeb3aa14a6eaf0d8d (patch) | |
tree | 7185da37593987f6084254f46705e2fe0890da65 /sal/osl/unx/profile.cxx | |
parent | 7965bb9a1d8b29778c6eac279537952e6a9e9502 (diff) |
loplugin:buriedassign in sal
Change-Id: I5a7bc9378ceacb9116c03e3a9fc01c5675c40908
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92243
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/unx/profile.cxx')
-rw-r--r-- | sal/osl/unx/profile.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index edb76019ff5d..ce3742bc8a10 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -391,8 +391,8 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile, if (! (pProfile->m_Flags & osl_Profile_SYSTEM)) { - osl_TProfileSection* pSec; - if (((pSec = findEntry(pProfile, pszSection, pszEntry, &NoEntry)) != nullptr) && + osl_TProfileSection* pSec = findEntry(pProfile, pszSection, pszEntry, &NoEntry); + if ((pSec != nullptr) && (NoEntry < pSec->m_NoEntries) && ((pStr = strchr(pProfile->m_Lines[pSec->m_Entries[NoEntry].m_Line], '=')) != nullptr)) @@ -535,7 +535,8 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile, Line[1 + strlen(pszSection)] = ']'; Line[2 + strlen(pszSection)] = '\0'; - if (((pStr = addLine(pProfile, Line)) == nullptr) || + pStr = addLine(pProfile, Line); + if ((pStr == nullptr) || (! addSection(pProfile, pProfile->m_NoLines - 1, &pStr[1], strlen(pszSection)))) { bRet=releaseProfile(pProfile); @@ -563,7 +564,8 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile, else i = pSec->m_Line + 1; - if (((pStr = insertLine(pProfile, Line, i)) == nullptr) || + pStr = insertLine(pProfile, Line, i); + if ((pStr == nullptr) || (! addEntry(pProfile, pSec, i, pStr, strlen(pszEntry)))) { bRet=releaseProfile(pProfile); @@ -675,8 +677,8 @@ sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile, if (! (pProfile->m_Flags & osl_Profile_SYSTEM)) { - osl_TProfileSection* pSec; - if (((pSec = findEntry(pProfile, pszSection, pszEntry, &NoEntry)) != nullptr) && + osl_TProfileSection* pSec = findEntry(pProfile, pszSection, pszEntry, &NoEntry); + if ((pSec != nullptr) && (NoEntry < pSec->m_NoEntries)) { removeLine(pProfile, pSec->m_Entries[NoEntry].m_Line); |