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>
commit72c6169b21793da91b3e652ae5f1e21c45c067d3
parent5002109313f914674d20a2fac1c38ce5360fb67d
authorDenis Shienkov <denis.shienkov@gmail.com>
committerDenis Shienkov <denis.shienkov@gmail.com>
commit timeFri, 1 Aug 2014 20:55:31 +0200