diff --git a/string/public/nsReadableUtils.h b/string/public/nsReadableUtils.h index 6431fe5e98b..ebc59cf9011 100755 --- a/string/public/nsReadableUtils.h +++ b/string/public/nsReadableUtils.h @@ -133,9 +133,10 @@ ToUpperCase(basic_nsAWritableString& aString) while ( start != end ) { PRUint32 fraglen = start.size_forward(); + PRUint32 num_bytes = fraglen; CharT *buf = start.get(); - while ( fraglen-- ) { + while ( num_bytes-- ) { *buf = nsCRT::ToUpper(*buf); ++buf; } @@ -156,9 +157,10 @@ ToLowerCase(basic_nsAWritableString& aString) while ( start != end ) { PRUint32 fraglen = start.size_forward(); + PRUint32 num_bytes = fraglen; CharT *buf = start.get(); - while ( fraglen-- ) { + while ( num_bytes-- ) { *buf = nsCRT::ToLower(*buf); ++buf; } diff --git a/xpcom/ds/nsReadableUtils.h b/xpcom/ds/nsReadableUtils.h index 6431fe5e98b..ebc59cf9011 100755 --- a/xpcom/ds/nsReadableUtils.h +++ b/xpcom/ds/nsReadableUtils.h @@ -133,9 +133,10 @@ ToUpperCase(basic_nsAWritableString& aString) while ( start != end ) { PRUint32 fraglen = start.size_forward(); + PRUint32 num_bytes = fraglen; CharT *buf = start.get(); - while ( fraglen-- ) { + while ( num_bytes-- ) { *buf = nsCRT::ToUpper(*buf); ++buf; } @@ -156,9 +157,10 @@ ToLowerCase(basic_nsAWritableString& aString) while ( start != end ) { PRUint32 fraglen = start.size_forward(); + PRUint32 num_bytes = fraglen; CharT *buf = start.get(); - while ( fraglen-- ) { + while ( num_bytes-- ) { *buf = nsCRT::ToLower(*buf); ++buf; } diff --git a/xpcom/string/public/nsReadableUtils.h b/xpcom/string/public/nsReadableUtils.h index 6431fe5e98b..ebc59cf9011 100755 --- a/xpcom/string/public/nsReadableUtils.h +++ b/xpcom/string/public/nsReadableUtils.h @@ -133,9 +133,10 @@ ToUpperCase(basic_nsAWritableString& aString) while ( start != end ) { PRUint32 fraglen = start.size_forward(); + PRUint32 num_bytes = fraglen; CharT *buf = start.get(); - while ( fraglen-- ) { + while ( num_bytes-- ) { *buf = nsCRT::ToUpper(*buf); ++buf; } @@ -156,9 +157,10 @@ ToLowerCase(basic_nsAWritableString& aString) while ( start != end ) { PRUint32 fraglen = start.size_forward(); + PRUint32 num_bytes = fraglen; CharT *buf = start.get(); - while ( fraglen-- ) { + while ( num_bytes-- ) { *buf = nsCRT::ToLower(*buf); ++buf; }