Bug 58221 don't use strlen to check if a string is of length 0
patch by aaronl@vitelus.com r=timeless sr=bz git-svn-id: svn://10.0.0.236/trunk@133999 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -184,7 +184,7 @@ MyPrefChangedCallback(const char*aPrefName, void* instance_data)
|
||||
rv = prefs->GetLocalizedUnicharPref("intl.charset.detector",
|
||||
&detector_name)))
|
||||
{
|
||||
if(nsCRT::strlen(detector_name) > 0) {
|
||||
if(detector_name && *detector_name) {
|
||||
PL_strncpy(g_detector_contractid, NS_CHARSET_DETECTOR_CONTRACTID_BASE,DETECTOR_CONTRACTID_MAX);
|
||||
PL_strncat(g_detector_contractid, NS_ConvertUCS2toUTF8(detector_name).get(),DETECTOR_CONTRACTID_MAX);
|
||||
gPlugDetector = PR_TRUE;
|
||||
@@ -581,7 +581,7 @@ nsHTMLDocument::TryCacheCharset(nsICacheEntryDescriptor* aCacheDescriptor,
|
||||
nsXPIDLCString cachedCharset;
|
||||
rv = aCacheDescriptor->GetMetaDataElement("charset",
|
||||
getter_Copies(cachedCharset));
|
||||
if (NS_SUCCEEDED(rv) && PL_strlen(cachedCharset) > 0)
|
||||
if (NS_SUCCEEDED(rv) && !cachedCharset.IsEmpty())
|
||||
{
|
||||
aCharset.Assign(NS_ConvertASCIItoUCS2(cachedCharset));
|
||||
aCharsetSource = kCharsetFromCache;
|
||||
|
||||
Reference in New Issue
Block a user