From 6789fb9b2125734c81a0af23ad92d0eacbc1c77b Mon Sep 17 00:00:00 2001 From: parsons Date: Wed, 6 Aug 2008 19:15:30 +0000 Subject: ChangeLogTag: Wed Aug 6 19:08:39 UTC 2008 Jeff Parsons --- TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp | 23 ++++++++++++++-------- .../libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp | 19 +++++++++++------- 2 files changed, 27 insertions(+), 15 deletions(-) (limited to 'TAO/tests/CodeSets') diff --git a/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp b/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp index 51bba525e67..f63c6e541d3 100644 --- a/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp +++ b/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp @@ -500,24 +500,31 @@ WUCS4_UTF16::write_wstring (ACE_OutputCDR & cdr, ACE_UTF16_T bom = ACE_UNICODE_BOM_CORRECT; ACE_CDR::ULong length = len + count_potential_surrogates (x, len); ACE_CDR::ULong l = length * ACE_UTF16_CODEPOINT_SIZE; + if (this->write_4 (cdr, &l) && x != 0) { - this->write_2 (cdr,&bom); + this->write_2 (cdr, &bom); return this->write_measured_wchar_array (cdr, x, len, length); } } else { ACE_CDR::ULong l = len + 1; + if (this->write_4 (cdr, &l)) - if (x != 0) - return this->write_wchar_array (cdr, x, len + 1); - else - { - ACE_UTF16_T s = 0; - return this->write_2 (cdr,&s); - } + { + if (x != 0) + { + return this->write_wchar_array (cdr, x, len + 1); + } + else + { + ACE_UTF16_T s = 0; + return this->write_2 (cdr, &s); + } + } } + return 0; } diff --git a/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp b/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp index da5e1522c7d..63fd91f1acb 100644 --- a/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp +++ b/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp @@ -276,14 +276,19 @@ UTF16_UCS2_Translator::write_wstring (ACE_OutputCDR & cdr, { // pre GIOP 1.2: include null terminator in length ACE_CDR::ULong l = len + 1; + if (this->write_4 (cdr, &l)) - if (x != 0) - return this->write_wchar_array_i (cdr, x, len + 1); - else - { - ACE_UTF16_T s = 0; - return this->write_2 (cdr, &s); - } + { + if (x != 0) + { + return this->write_wchar_array_i (cdr, x, len + 1); + } + else + { + ACE_UTF16_T s = 0; + return this->write_2 (cdr, &s); + } + } } return 0; -- cgit v1.2.1