From d45d8c2bc94dc26c30db754b40db949ab4df5da8 Mon Sep 17 00:00:00 2001 From: "kaie%netscape.com" Date: Wed, 1 May 2002 14:02:11 +0000 Subject: [PATCH] b=141317 CopyToLowerCase produces strings with random content r=jag sr=alecf --- string/src/nsReadableUtils.cpp | 4 ++++ xpcom/string/src/nsReadableUtils.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/string/src/nsReadableUtils.cpp b/string/src/nsReadableUtils.cpp index 9b9dd7ab666d..a01023309ca9 100755 --- a/string/src/nsReadableUtils.cpp +++ b/string/src/nsReadableUtils.cpp @@ -441,6 +441,8 @@ class CopyToUpperCase char ch = *aSource; if ((ch >= 'a') && (ch <= 'z')) *cp = ch - ('a' - 'A'); + else + *cp = ch; ++aSource; ++cp; } @@ -535,6 +537,8 @@ class CopyToLowerCase char ch = *aSource; if ((ch >= 'A') && (ch <= 'Z')) *cp = ch + ('a' - 'A'); + else + *cp = ch; ++aSource; ++cp; } diff --git a/xpcom/string/src/nsReadableUtils.cpp b/xpcom/string/src/nsReadableUtils.cpp index 9b9dd7ab666d..a01023309ca9 100755 --- a/xpcom/string/src/nsReadableUtils.cpp +++ b/xpcom/string/src/nsReadableUtils.cpp @@ -441,6 +441,8 @@ class CopyToUpperCase char ch = *aSource; if ((ch >= 'a') && (ch <= 'z')) *cp = ch - ('a' - 'A'); + else + *cp = ch; ++aSource; ++cp; } @@ -535,6 +537,8 @@ class CopyToLowerCase char ch = *aSource; if ((ch >= 'A') && (ch <= 'Z')) *cp = ch + ('a' - 'A'); + else + *cp = ch; ++aSource; ++cp; }