diff --git a/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp b/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp index cbebd0b2f5a..750a5791266 100644 --- a/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp +++ b/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp @@ -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():"