diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2014-07-10 16:46:28 +0400 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2014-08-01 20:55:31 +0200 |
commit | 72c6169b21793da91b3e652ae5f1e21c45c067d3 (patch) | |
tree | 7219f008538b773e209357ffbbd361c4f01f395f /qtserialport.pro | |
parent | 5002109313f914674d20a2fac1c38ce5360fb67d (diff) | |
download | qtserialport-72c6169b21793da91b3e652ae5f1e21c45c067d3.tar.gz |
Pass a length of string to QString::fromWCharArray
Using of the QString::fromWCharArray() we didn't pass length of a string,
hoping that all WCHAR strings are terminated by the null-character.
But it can lead to the wrong results if the initial WCHAR string has no
null character. Therefore it is reasonable to pass length of a string to
exclude an error.
Besides, to do not break of the algorithm of string comparison it is
necessary to return not null-terminated strings. Also now there is no need
to initialize of some allocated arrays by zero values.
Tested on Windows 7/8 with the on-board, the virtual com0com, the USB FTDI
and the PL2303 serial ports, using Qt4 and then Qt5.
Change-Id: I382cf8eacf4ab4d21c54de17fcdd6b9fcfa3d02c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'qtserialport.pro')
0 files changed, 0 insertions, 0 deletions