diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-01-15 15:30:17 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-01-22 14:33:44 +0000 |
commit | c38c7965e7ca6454a6624b99c00c0d3551bdbe52 (patch) | |
tree | 25cd27f752db48b5d1f94bddf62cc0f65e8c51d4 /src/bluetooth/qleadvertiser_bluez.cpp | |
parent | dcefaed1d8c6d4e5e10e2a79b638f6bb07961ef1 (diff) |
Bluetooth LE: Fix check for space left in advertising data.
The value we compare against can be smaller than zero.
Change-Id: Iea67ea3439d966ff24f93e63870a3b487f4c4644
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qleadvertiser_bluez.cpp')
-rw-r--r-- | src/bluetooth/qleadvertiser_bluez.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bluetooth/qleadvertiser_bluez.cpp b/src/bluetooth/qleadvertiser_bluez.cpp index 5f6cdcfc..2e2408ba 100644 --- a/src/bluetooth/qleadvertiser_bluez.cpp +++ b/src/bluetooth/qleadvertiser_bluez.cpp @@ -242,7 +242,7 @@ template<typename T> static void addServicesData(AdvData &data, const QVector<T> return; const int spaceAvailable = sizeof data.data - data.length; const int maxServices = qMin<int>((spaceAvailable - 2) / sizeof(T), services.count()); - if (maxServices == 0) { + if (maxServices <= 0) { qCWarning(QT_BT_BLUEZ) << "services data does not fit into advertising data packet"; return; } |