Fix incorrect array length calculation + add temporary variable to work around egcs compiler bug which was causing bogus text to appear in the LDAP auth dialog on linux (bug 148897); r=bryner@netscape.com, sr=bienvenu@netscape.com

This commit is contained in:
dmose%netscape.com 2005-11-15 20:09:00 +00:00
Родитель 2f0889448a
Коммит b82e03f2ab
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -517,14 +517,20 @@ nsLDAPAutoCompleteSession::OnLDAPInit(nsresult aStatus)
UNBOUND);
return rv;
}
const PRUnichar *hostArray[1] = { NS_ConvertASCIItoUCS2(host).get() };
// hostTemp is only necessary to work around a code-generation
// bug in egcs 1.1.2 (the version of gcc that comes with Red Hat 6.2),
// which is the default compiler for Mozilla on linux at the moment.
//
NS_ConvertASCIItoUCS2 hostTemp(host);
const PRUnichar *hostArray[1] = { hostTemp.get() };
// format the hostname into the authprompt text string
//
nsXPIDLString authPromptText;
rv = ldapBundle->FormatStringFromName(
NS_LITERAL_STRING("authPromptText").get(),
hostArray, sizeof(hostArray),
hostArray, sizeof(hostArray) / sizeof(const PRUnichar *),
getter_Copies(authPromptText));
if (NS_FAILED(rv)) {
NS_ERROR("nsLDAPAutoCompleteSession::OnLDAPInit():"