This commit is contained in:
dp%netscape.com 2000-02-06 09:40:51 +00:00
Родитель 7a0ada6e35
Коммит 1c74a6ee7b
1 изменённых файлов: 7 добавлений и 3 удалений

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

@ -80,8 +80,12 @@ NS_IMETHODIMP nsBasicStreamGenerator::GetByte(PRUint32 offset, PRUint8 *retval)
nsAllocator::Free(aPassword);
}
// Get the offset byte from the stream. Our stream is
// just our password repeating itself infinite times.
*retval = mPassword[offset % mPassword.Length()];
// Get the offset byte from the stream. Our stream is just our password
// repeating itself infinite times.
//
// mPassword being a nsCString, returns a PRUnichar for operator [].
// Hence convert it to a const char * first before applying op [].
*retval = ((const char *)mPassword)[offset % mPassword.Length()];
return rv;
}