Kaydet (Commit) eea5ad99 authored tarafından Caolán McNamara's avatar Caolán McNamara

cppcheck: redundantCopy

Change-Id: I209b55a6ef962d4a350327e56c4d16c8180a21e0
üst 7e1d81cc
...@@ -518,8 +518,8 @@ namespace rtl_ustr ...@@ -518,8 +518,8 @@ namespace rtl_ustr
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode); sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc( nLength + sizeof(sal_Unicode)); // length + 1 (null terminator) sal_Unicode* pStr = (sal_Unicode*) malloc( nLength + sizeof(sal_Unicode)); // length + 1 (null terminator)
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL); CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
memset(pStr, 0, nLength + sizeof(sal_Unicode));
memcpy(pStr, aStr1.getStr(), nLength); memcpy(pStr, aStr1.getStr(), nLength);
pStr[aStr1.getLength()] = 0;
rtl_ustr_replaceChar( pStr, 'e', 'u' ); rtl_ustr_replaceChar( pStr, 'e', 'u' );
rtl::OUString suStr(pStr, aStr1.getLength()); rtl::OUString suStr(pStr, aStr1.getLength());
...@@ -614,8 +614,8 @@ namespace rtl_ustr ...@@ -614,8 +614,8 @@ namespace rtl_ustr
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode); sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode) ); // we need to add '\0' so one more sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode) ); // we need to add '\0' so one more
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL); CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
memset(pStr, 0, nLength + sizeof(sal_Unicode)); // empty the sal_Unicode array
memcpy(pStr, aStr1.getStr(), nLength); memcpy(pStr, aStr1.getStr(), nLength);
pStr[aStr1.getLength()] = 0;
rtl_ustr_toAsciiLowerCase( pStr ); rtl_ustr_toAsciiLowerCase( pStr );
rtl::OUString suStr(pStr, aStr1.getLength()); rtl::OUString suStr(pStr, aStr1.getLength());
...@@ -693,8 +693,8 @@ namespace rtl_ustr ...@@ -693,8 +693,8 @@ namespace rtl_ustr
sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode); sal_uInt32 nLength = aStr1.getLength() * sizeof(sal_Unicode);
sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator sal_Unicode* pStr = (sal_Unicode*) malloc(nLength + sizeof(sal_Unicode)); // length + null terminator
CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL); CPPUNIT_ASSERT_MESSAGE("can't get memory for test", pStr != NULL);
memset(pStr, 0, nLength + sizeof(sal_Unicode));
memcpy(pStr, aStr1.getStr(), nLength); memcpy(pStr, aStr1.getStr(), nLength);
pStr[aStr1.getLength()] = 0;
rtl_ustr_toAsciiUpperCase( pStr ); rtl_ustr_toAsciiUpperCase( pStr );
rtl::OUString suStr(pStr, aStr1.getLength()); rtl::OUString suStr(pStr, aStr1.getLength());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment