241292 - proxy settings with ports specified are not imported properly. use nsCAutoStrings instead of nsDependentCStrings because we need null terminated strings containing only the fragment returned by Substring().

This commit is contained in:
ben%bengoodger.com 2004-05-23 08:31:59 +00:00
parent 17531a3296
commit deeca5d835

View File

@ -44,10 +44,10 @@ void SetProxyPref(const nsACString& aHostPort, const char* aPref,
{
nsCAutoString hostPort(aHostPort);
PRInt32 portDelimOffset = hostPort.RFindChar(':');
if (portDelimOffset) {
nsDependentCString host(Substring(hostPort, 0, portDelimOffset));
nsDependentCString port(Substring(hostPort, portDelimOffset + 1,
hostPort.Length() - (portDelimOffset + 1)));
if (portDelimOffset > 0) {
nsCAutoString host(Substring(hostPort, 0, portDelimOffset));
nsCAutoString port(Substring(hostPort, portDelimOffset + 1,
hostPort.Length() - (portDelimOffset + 1)));
aPrefs->SetCharPref(aPref, host.get());
PRInt32 stringErr;