forked from qt-creator/qt-creator
Sending a string should send a trainling zero as well.
This commit is contained in:
@@ -1442,8 +1442,6 @@ void Adapter::startInferiorIfNeeded()
|
||||
appendByte(&ba, 0); // ?
|
||||
|
||||
QByteArray file("C:\\sys\\bin\\filebrowseapp.exe");
|
||||
file.append('\0');
|
||||
file.append('\0');
|
||||
appendString(&ba, file, TargetByteOrder);
|
||||
sendTrkMessage(0x40, CB(handleCreateProcess), ba); // Create Item
|
||||
}
|
||||
|
@@ -629,10 +629,7 @@ void Adapter::startInferiorIfNeeded()
|
||||
appendByte(&ba, 0); // ?
|
||||
appendByte(&ba, 0); // ?
|
||||
appendByte(&ba, 0); // ?
|
||||
QByteArray file = m_fileName.toLocal8Bit();
|
||||
file.append('\0');
|
||||
file.append('\0');
|
||||
appendString(&ba, file, TargetByteOrder);
|
||||
appendString(&ba, m_fileName.toLocal8Bit(), TargetByteOrder);
|
||||
sendTrkMessage(TrkCreateItem, CB(handleCreateProcess), ba); // Create Item
|
||||
}
|
||||
|
||||
|
@@ -264,9 +264,10 @@ void appendInt(QByteArray *ba, uint i, Endianness endian)
|
||||
void appendString(QByteArray *ba, const QByteArray &str, Endianness endian)
|
||||
{
|
||||
const int n = str.size();
|
||||
appendShort(ba, n, endian);
|
||||
appendShort(ba, n+1, endian); // count the terminating \0
|
||||
for (int i = 0; i != n; ++i)
|
||||
ba->append(str.at(i));
|
||||
ba->append('\0');
|
||||
}
|
||||
|
||||
QByteArray errorMessage(byte code)
|
||||
|
Reference in New Issue
Block a user