Mr-Ntic / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

Port names are not correctly null terminated contain garbage symbols #88

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I use Qt 4.7.2 with minGW 4.4 / Eclipse integration
2.Use QextSerialEnumerator::getPorts()
3.read portName member of returned struct

What is the expected output? What do you see instead?
Should read "COM1", "COM2" ... Instead of this I read QString object, long 10 
characters, null terminated at the middle, which contains illegal symbols (code 
from near memory addresses)

What version of the product are you using? On what operating system?
Qt 4.7.2, mingw 4.4, QextSerialPort-1.2win
OS: WinXP
Exe code produced from mingw, produces same effect on different machines.

Please provide any additional information below.
Sample code:

        portList = QextSerialEnumerator::getPorts();    
    for(it=0;it<portList.size();it++)
    {       
        qDebug() << portList.at(it).portName;
        qDebug() << portList.at(it).portName.size();
        qDebug() << portList.at(it).portName.toAscii().toHex();
    }

Output of this:

"COM1
10 
"434f4d3100223f220303" 
"COM2
10 
"434f4d3200003f3f0303" 

On next execution there are differences:

"COM1
10 
"434f4d31003f033f0403" 
"COM2
10 
"434f4d32003f3f3f0203" 

Original issue reported on code.google.com by atanasuz...@gmail.com on 10 Mar 2011 at 4:04

GoogleCodeExporter commented 8 years ago
This issue has been solved [at 2009-08], please download latest code from 
repository and try again.

Original comment by dbzhang...@gmail.com on 10 Nov 2011 at 4:47

GoogleCodeExporter commented 8 years ago

Original comment by dbzhang...@gmail.com on 16 Mar 2012 at 8:58