Bug 620390 useless null check of host = flat.get() in nsStandardURL::SetHost

r=biesi
This commit is contained in:
timeless@mozdev.org 2011-03-23 23:29:47 -04:00
parent 0a36ca716b
commit 64666d52c4

View File

@ -1428,7 +1428,7 @@ nsStandardURL::SetHost(const nsACString &input)
return NS_ERROR_UNEXPECTED;
}
if (host && strlen(host) < flat.Length())
if (strlen(host) < flat.Length())
return NS_ERROR_MALFORMED_URI; // found embedded null
// For consistency with SetSpec/nsURLParsers, don't allow spaces
@ -1439,7 +1439,7 @@ nsStandardURL::SetHost(const nsACString &input)
InvalidateCache();
mHostEncoding = eEncoding_ASCII;
if (!(host && *host)) {
if (!*host) {
// remove existing hostname
if (mHost.mLen > 0) {
// remove entire authority