#59666, Occurances of uninitialized variables being used before being set.
r = nhotta, sr=erik git-svn-id: svn://10.0.0.236/trunk@82735 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user