diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-15 01:57:12 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-10-17 09:53:42 +0200 |
commit | d51db77c8d87f210785a8a8c6dd875f7bacddb3c (patch) | |
tree | fd1ab208d49e85371fc9bb321539ce137bdaf719 /comphelper | |
parent | c8eaadb5d70f42723517bb028f363e37726be256 (diff) |
Remove some memset calls
Replace them with default initialization or calloc
Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1
Reviewed-on: https://gerrit.libreoffice.org/80805
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/docpasswordhelper.cxx | 6 | ||||
-rw-r--r-- | comphelper/source/misc/syntaxhighlight.cxx | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 7bae3a77aaf0..cf665dd6c147 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -331,8 +331,7 @@ OUString DocPasswordHelper::GetOoxHashAsBase64( uno::Sequence< sal_Int8 > aResultKey; if ( !aPassword.isEmpty() && aDocId.getLength() == 16 ) { - sal_uInt16 pPassData[16]; - memset( pPassData, 0, sizeof(pPassData) ); + sal_uInt16 pPassData[16] = {}; sal_Int32 nPassLen = std::min< sal_Int32 >( aPassword.getLength(), 15 ); memcpy( pPassData, aPassword.getStr(), nPassLen * sizeof(pPassData[0]) ); @@ -360,8 +359,7 @@ OUString DocPasswordHelper::GetOoxHashAsBase64( uno::Sequence< sal_Int8 > aResultKey; if ( pPassData[0] ) { - sal_uInt8 pKeyData[64]; - memset( pKeyData, 0, sizeof(pKeyData) ); + sal_uInt8 pKeyData[64] = {}; sal_Int32 nInd = 0; diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index 3fb5bc057094..b3f62a70365b 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -268,7 +268,7 @@ namespace class SyntaxHighlighter::Tokenizer { // Character information tables - CharFlags aCharTypeTab[256]; + CharFlags aCharTypeTab[256] = {}; // Auxiliary function: testing of the character flags bool testCharFlags(sal_Unicode c, CharFlags nTestFlags) const; @@ -590,8 +590,6 @@ bool SyntaxHighlighter::Tokenizer::getNextToken(const sal_Unicode*& pos, /*out*/ SyntaxHighlighter::Tokenizer::Tokenizer( HighlighterLanguage aLang ): aLanguage(aLang) { - memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) ); - // Fill character table sal_uInt16 i; |