Issue Details (XML | Word | Printable)

Key: CORE-1594
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

BUG in CsConvert::convert

Created: 14/Nov/07 03:31 PM   Updated: 20/Aug/16 06:03 PM
Component/s: Engine
Affects Version/s: 2.1 Alpha 1, 2.1 Beta 1, 2.1 Beta 2
Fix Version/s: 2.1 RC1

File Attachments: 1. Text File CsConvert.h (8 kB)

QA Status: Cannot be tested

 Description  « Hide
Wrong cycle of ignore trailing spaces
 - uses end of temp_buffer instead of end of data in temp_buffer

See corrected source in attach

PS. I make small refactoring of this code :))

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 16/Nov/07 03:27 AM
Dmitry, please take into an account for the future - doing reinterpret_cast<const USHORT*>(UCHAR*) (or any other cast leading to stronger alignment requirements) is very dangerous. If original data is not aligned properly, it will break all RISC builds (like sparc, parisc).
I understand that doing development on machines where alignment is not 'must be' thing makes us forget about alignment issues, but please remember that firebird is also used on other CPUs.

Kovalenko Dmitry added a comment - 16/Nov/07 04:27 PM
Alexander, I know about problems with bad-alignment by RISC machines. Thanks :)

And I know, also, than separation of generic "csconvert" on "csconvert_ucs2_to_mbc" and "csconvert_mbc_to_ucs2" can prevent this problems.