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 2002-06-20 00:58:52 +00:00
Родитель f9ad83267e
Коммит 38abe0471a
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -315,14 +315,20 @@ NS_IMETHODIMP nsAbQueryLDAPMessageListener::OnLDAPInit(nsresult aStatus)
if (NS_FAILED(rv)) {
return NS_ERROR_FAILURE;
}
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("nsAbQueryLDAPMessageListener::OnLDAPInit():"