mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 01:55:44 +00:00
#59666, Occurances of uninitialized variables being used before being set.
r = nhotta, sr=erik
This commit is contained in:
parent
1342aa1546
commit
23f30f74ca
@ -221,6 +221,8 @@ nsCharDetModule::GetClassObject(nsIComponentManager *aCompMgr,
|
||||
delete factory; // XXX only works if virtual dtors were used!
|
||||
}
|
||||
}
|
||||
else
|
||||
rv = NS_ERROR_FACTORY_NOT_LOADED;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ void nsPSMDetector::Sample(const char* aBuf, PRUint32 aLen, PRBool aLastChance)
|
||||
printf(" after we receive enough data.\n");
|
||||
}
|
||||
#endif
|
||||
PRInt32 bestIdx;
|
||||
PRInt32 bestIdx = -1;
|
||||
PRInt32 eucCnt=0;
|
||||
float bestScore = 0.0f;
|
||||
for(j = 0; j < mItems; j++) {
|
||||
@ -462,12 +462,15 @@ void nsPSMDetector::Sample(const char* aBuf, PRUint32 aLen, PRBool aLastChance)
|
||||
} // if(( 0 == eucCnt++) || (bestScore > score ))
|
||||
} // if(nsnull != ...)
|
||||
} // for
|
||||
if (bestIdx >= 0)
|
||||
{
|
||||
#ifdef DETECTOR_DEBUG
|
||||
printf("Based on the statistic, we decide it is %s",
|
||||
mVerifier[mItemIdx[bestIdx]]->charset);
|
||||
printf("Based on the statistic, we decide it is %s",
|
||||
mVerifier[mItemIdx[bestIdx]]->charset);
|
||||
#endif
|
||||
Report( mVerifier[mItemIdx[bestIdx]]->charset);
|
||||
mDone = PR_TRUE;
|
||||
Report( mVerifier[mItemIdx[bestIdx]]->charset);
|
||||
mDone = PR_TRUE;
|
||||
}
|
||||
} // if (eucNum == nonUCS2Num)
|
||||
} // if(mRunSampler)
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ NS_IMETHODIMP nsUnicodeToISO2022JP::ConvertNoBuffNoErr(
|
||||
char * aDest,
|
||||
PRInt32 * aDestLength)
|
||||
{
|
||||
nsresult res;
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mHelper == nsnull) {
|
||||
res = nsComponentManager::CreateInstance(kUnicodeEncodeHelperCID, NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user