зеркало из https://github.com/mozilla/pjs.git
eliminate nsCRT::strlen for char* strings (part 2), bug 124536 r=dp sr=brendan
This commit is contained in:
Родитель
93709bacaa
Коммит
958ec3e92b
|
@ -3943,7 +3943,7 @@ SubstituteChars(PRBool aDisplayUnicode,
|
|||
nsAutoString tmp(aString, aLength); // we need to pass a null-terminated string
|
||||
gFontSubstituteConverter->Convert(tmp.get(), &conv);
|
||||
if (conv) {
|
||||
*aCount = nsCRT::strlen(conv);
|
||||
*aCount = strlen(conv);
|
||||
if (*aCount > aBufferLength) {
|
||||
// allocate a bigger array that the caller should free
|
||||
result = new PRUnichar[*aCount];
|
||||
|
|
|
@ -104,7 +104,7 @@ nsScriptableUnicodeConverter::ConvertToUnicode(const char *aSrc, PRUnichar **_re
|
|||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
PRInt32 inLength = nsCRT::strlen(aSrc);
|
||||
PRInt32 inLength = strlen(aSrc);
|
||||
PRInt32 outLength;
|
||||
rv = mDecoder->GetMaxLength(aSrc, inLength, &outLength);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
|
|
|
@ -135,7 +135,7 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeAndConvert(
|
|||
rv = ccm->GetUnicodeDecoder(&charsetStr, &decoder);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
PRUnichar *pBuf = nsnull;
|
||||
PRInt32 len = nsCRT::strlen(unescaped);
|
||||
PRInt32 len = strlen(unescaped);
|
||||
PRInt32 outlen = 0;
|
||||
if (NS_SUCCEEDED(rv = decoder->GetMaxLength(unescaped, len, &outlen))) {
|
||||
pBuf = (PRUnichar *) PR_Malloc((outlen+1)*sizeof(PRUnichar*));
|
||||
|
|
|
@ -285,7 +285,7 @@ nsSaveAsCharset::DoConversionFallBack(PRUnichar inCharacter, char *outString, PR
|
|||
char *entity = NULL;
|
||||
rv = mEntityConverter->ConvertToEntity(inCharacter, mEntityVersion, &entity);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (NULL == entity || (PRInt32)nsCRT::strlen(entity) > bufferLength) {
|
||||
if (NULL == entity || (PRInt32)strlen(entity) > bufferLength) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PL_strcpy(outString, entity);
|
||||
|
|
Загрузка…
Ссылка в новой задаче