diff --git a/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp b/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp index ccf79af9e99..b1ee5a99bf3 100644 --- a/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp +++ b/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp @@ -79,6 +79,8 @@ #include "nsIServiceManager.h" #include "nsIEventQueueService.h" #include "nsRDFCID.h" +#include "nsMsgBaseCID.h" +#include "nsMsgLocalCID.h" #ifdef XP_PC #define NETLIB_DLL "netlib.dll" @@ -307,19 +309,18 @@ void nsMailboxTestDriver::InitializeTestDriver() // propogating bienvenu's preferences hack..... #define ROOT_PATH_LENGTH 128 - char rootPath[ROOT_PATH_LENGTH]; - int rootLen = ROOT_PATH_LENGTH; + char* rootPath; nsIPref* prefs; nsresult rv; rv = nsServiceManager::GetService(kPrefCID, kIPrefIID, (nsISupports**)&prefs); if (prefs && NS_SUCCEEDED(rv)) { prefs->Startup("prefs50.js"); - rv = prefs->GetCharPref(kMsgRootFolderPref, rootPath, &rootLen); + rv = prefs->GetCharPref(kMsgRootFolderPref, &rootPath); nsServiceManager::ReleaseService(kPrefCID, prefs); } - if (rootLen > 0) // how many bytes did they write into our buffer? + if (NS_SUCCEEDED(rv))) { m_folderSpec = rootPath; } diff --git a/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp b/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp index c12688b6866..d1d7fd4810b 100644 --- a/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp +++ b/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp @@ -766,11 +766,9 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoHome(void) // Find the home page stored in prefs if (m_pIPref) { - char szBuffer[512]; + char *szBuffer; nsresult rv; - int nBufLen = sizeof(szBuffer) / sizeof(szBuffer[0]); - memset(szBuffer, 0, sizeof(szBuffer)); - rv = m_pIPref->GetCharPref(c_szPrefsHomePage, szBuffer, &nBufLen); + rv = m_pIPref->CopyCharPref(c_szPrefsHomePage, &szBuffer); if (rv == NS_OK) { sUrl = A2T(szBuffer);