From 6a011f0d92ba45e13ada2d5cd6e69715658b1439 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 16 Dec 2014 14:22:13 -0600 Subject: [PATCH] mpdu: Simplify checks --- src/mpdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mpdu.c b/src/mpdu.c index df4da93d..98d0fbfb 100644 --- a/src/mpdu.c +++ b/src/mpdu.c @@ -43,7 +43,7 @@ static inline bool next_byte(const unsigned char *mpdu, int len, static inline bool next_2bytes(const unsigned char *mpdu, int len, int *offset, uint16_t *holder) { - if (len == *offset || len < *offset + 2) + if (len < *offset + 2) return false; *holder = L_LE16_TO_CPU(*((uint16_t *) mpdu+*offset)); @@ -57,7 +57,7 @@ static inline bool next_data(const unsigned char *mpdu, int len, { int i; - if (len == *offset || len < *offset + t_len) + if (len < *offset + t_len) return false; for (i = 0; i < t_len; i++)