summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2017-01-26 15:10:52 +0100
committerOliver Wolff <oliver.wolff@qt.io>2017-01-30 11:04:20 +0000
commit6cb829a3d123090583082bc4e93af41fdb4bc5e9 (patch)
treeb24cef3e79e4fad8ed4deefd02f4268865e922b8 /src
parent6b69a54a02c5deb61eaceec1c432a970d4f1da90 (diff)
winrt: Fixed reading of string attributes in sequences
Change-Id: I063668f9b95b95aa15a736b80e11d81c15cd1730 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_winrt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_winrt.cpp
index 1d98874f..29ccb290 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_winrt.cpp
@@ -427,6 +427,9 @@ QBluetoothServiceInfo::Sequence QWinRTBluetoothServiceDiscoveryWorker::readSeque
BYTE length;
hr = dataReader->ReadByte(&length);
Q_ASSERT_SUCCEEDED(hr);
+ remainingLength -= 1;
+ if (bytesRead)
+ *bytesRead += 1;
HString value;
hr = dataReader->ReadString(length, value.GetAddressOf());
Q_ASSERT_SUCCEEDED(hr);
@@ -435,7 +438,7 @@ QBluetoothServiceInfo::Sequence QWinRTBluetoothServiceDiscoveryWorker::readSeque
result.append(QVariant::fromValue(str));
remainingLength -= length;
if (bytesRead)
- *bytesRead += 2;
+ *bytesRead += length;
break;
}
case TYPE_SEQUENCE: {