aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSyam Sidhardhan <s.syam@samsung.com>2012-04-16 18:31:38 +0530
committerJohan Hedberg <johan.hedberg@intel.com>2012-04-16 22:55:54 +0300
commitbae8dc7356756927c478f5fff28453bed481471f (patch)
treea5f5a7578c0190cc1ad3345492aea510489fcc2e
parent3424dc81ef8c5c83a78cf3e0cd6c38f075f44fce (diff)
downloadbluez-bae8dc7356756927c478f5fff28453bed481471f.tar.gz
bluez-bae8dc7356756927c478f5fff28453bed481471f.tar.xz
bluez-bae8dc7356756927c478f5fff28453bed481471f.zip
eir: Fix incorrect eir_has_data_type() parsing
Updating the "parsed" variable twice inside the for loop, leads to incorrect parsing.
-rw-r--r--src/eir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eir.c b/src/eir.c
index 3b2db9e0..310cd536 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -342,9 +342,9 @@ void eir_create(const char *name, int8_t tx_power, uint16_t did_vendor,
gboolean eir_has_data_type(uint8_t *data, size_t len, uint8_t type)
{
uint8_t field_len;
- size_t parsed;
+ size_t parsed = 0;
- for (parsed = 0; parsed < len - 1; parsed += field_len) {
+ while (parsed < len - 1) {
field_len = data[0];
if (field_len == 0)