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
parent fba298ee31
commit d4e20c5288

View File

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