From 6c015b98c9514e8cab9be137bcad4b8c2b708091 Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Mon, 27 Nov 2017 19:03:43 +0000 Subject: [PATCH] BLE: Fix greater than or equal to comparision in GattCharacteristic. --- features/FEATURE_BLE/ble/GattCharacteristic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/FEATURE_BLE/ble/GattCharacteristic.h b/features/FEATURE_BLE/ble/GattCharacteristic.h index a192563e2f..9f0a246b2e 100644 --- a/features/FEATURE_BLE/ble/GattCharacteristic.h +++ b/features/FEATURE_BLE/ble/GattCharacteristic.h @@ -85,7 +85,7 @@ * A characteristic is a typed value used in a service. It contains a set of * properties that define client operations supported by the characteristic. * A characteristic may also include descriptors; a descriptor exposes - * metainformation associated to a characteristic, such as the unit of its value, + * metainformation associated to a characteristic, such as the unit of its value, * its human readable name or a control point attribute that allows the client to * subscribe to the characteristic notifications. * @@ -1632,7 +1632,7 @@ public: */ GattAttribute *getDescriptor(uint8_t index) { - if (index = _descriptorCount) { + if (index >= _descriptorCount) { return NULL; }