Fix orange by exiting loop when bytes hits aMaxBytes rather than waiting for it to get farther.

This commit is contained in:
dbaron%fas.harvard.edu 2001-12-04 04:22:44 +00:00
Родитель fba298ee31
Коммит d4e20c5288
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -276,7 +276,7 @@ UTF8InputStream::CountValidUTF8Bytes(const char* aBuffer, PRInt32 aMaxBytes)
const char *lastchar = aBuffer; const char *lastchar = aBuffer;
PRInt32 bytes = 0; PRInt32 bytes = 0;
while (*c && bytes <= aMaxBytes) { while (*c && bytes < aMaxBytes) {
lastchar = c; lastchar = c;
if (UTF8traits::isASCII(*c)) { if (UTF8traits::isASCII(*c)) {
c++; c++;