diff options
Diffstat (limited to 'jvmfwk')
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx | 2 | ||||
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx index f3586af32bb5..56972ea0e66f 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx @@ -159,7 +159,7 @@ bool SunVersion::init(const char *szVersion) { //1.4.1_01-, 1.4.1_01a, the numerical part may only be 2 chars. int len = pCur - pLast; - if (len != 2) + if (len > 2) return false; //we've got the update: 01, 02 etc strncpy(buf, pLast, len); diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 055bdae919f3..57b7166d01f6 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -241,9 +241,9 @@ FileHandleReader::readLine(rtl::OString * pLine) { if (m_nIndex == m_nSize) { - sal_uInt64 nRead; + sal_uInt64 nRead = 0; switch (osl_readFile( - m_aGuard.getHandle(), m_aBuffer, BUFFER_SIZE, &nRead)) + m_aGuard.getHandle(), m_aBuffer, sizeof(m_aBuffer), &nRead)) { case osl_File_E_PIPE: //HACK! for windows nRead = 0; @@ -256,8 +256,8 @@ FileHandleReader::readLine(rtl::OString * pLine) m_nIndex = 0; m_nSize = static_cast< int >(nRead); break; - case osl_File_E_INTR: - continue; + case osl_File_E_INTR: + continue; default: return RESULT_ERROR; @@ -483,19 +483,21 @@ bool getJavaProps(const OUString & exePath, */ rtl::OUString decodeOutput(const rtl::OString& s) { - OUString sEncoded = OStringToOUString(s, RTL_TEXTENCODING_ASCII_US); OUStringBuffer buff(512); sal_Int32 nIndex = 0; do { - OUString aToken = sEncoded.getToken( 0, ' ', nIndex ); + OString aToken = s.getToken( 0, ' ', nIndex ); if (aToken.getLength()) { - sal_Unicode value = (sal_Unicode) aToken.toInt32(); + sal_Unicode value = (sal_Unicode)(aToken.toInt32()); buff.append(value); } } while (nIndex >= 0); - return buff.makeStringAndClear(); + + OUString sDecoded(buff.makeStringAndClear()); + JFW_TRACE2(sDecoded); + return sDecoded; } |