From d80333e9e0ea13285568c6a8593ec821fc0953f6 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Fri, 24 Apr 2009 10:48:04 +0000 Subject: [PATCH] Fixed problem with LOWER/UPPER and NONE/ASCII parameter - reported by Dmitry --- src/jrd/intl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jrd/intl.cpp b/src/jrd/intl.cpp index 4fc7b28f7a..0178d28763 100644 --- a/src/jrd/intl.cpp +++ b/src/jrd/intl.cpp @@ -1196,6 +1196,7 @@ int INTL_str_to_upper(thread_db* tdbb, DSC * pString) USHORT ttype; int len = CVT_get_string_ptr(pString, &ttype, &src, reinterpret_cast(buffer), sizeof(buffer), ERR_post); + int i; UCHAR* dest; switch (ttype) { @@ -1206,7 +1207,8 @@ int INTL_str_to_upper(thread_db* tdbb, DSC * pString) case ttype_none: case ttype_ascii: dest = src; - while (len--) { + for (i = 0; i < len; ++i) + { *dest++ = UPPER7(*src); src++; } @@ -1245,6 +1247,7 @@ int INTL_str_to_lower(thread_db* tdbb, DSC * pString) USHORT ttype; int len = CVT_get_string_ptr(pString, &ttype, &src, reinterpret_cast(buffer), sizeof(buffer), ERR_post); + int i; UCHAR* dest; switch (ttype) { @@ -1255,7 +1258,8 @@ int INTL_str_to_lower(thread_db* tdbb, DSC * pString) case ttype_none: case ttype_ascii: dest = src; - while (len--) { + for (i = 0; i < len; ++i) + { *dest++ = LOWWER7(*src); src++; }