Skip to content

Commit

Permalink
Bug 624837 - use calculated string length instead of magic number; r=…
Browse files Browse the repository at this point in the history
…bagder

The original magic number is incorrect.

MozReview-Commit-ID: LtdnINTONHq
  • Loading branch information
xeonchen committed Jun 14, 2017
1 parent d65c407 commit e7a9099
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ nsWindowsSystemProxySettings::GetProxyForURI(const nsACString & aSpec,

NS_ConvertUTF16toUTF8 cbuf(buf);

NS_NAMED_LITERAL_CSTRING(kSocksPrefix, "socks=");
nsAutoCString prefix;
ToLowerCase(aScheme, prefix);

Expand Down Expand Up @@ -249,9 +250,9 @@ nsWindowsSystemProxySettings::GetProxyForURI(const nsACString & aSpec,
// (http://msdn.microsoft.com/en-us/library/aa383996%28VS.85%29.aspx)
specificProxy = Substring(proxy, prefix.Length());
break;
} else if (proxy.Find("socks=") == 0) {
} else if (proxy.Find(kSocksPrefix) == 0) {
// SOCKS proxy.
socksProxy = Substring(proxy, 5); // "socks=" length.
socksProxy = Substring(proxy, kSocksPrefix.Length()); // "socks=" length.
}
}

Expand Down

0 comments on commit e7a9099

Please sign in to comment.