diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-21 21:30:23 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-21 21:30:23 +0100 |
commit | 6058220d2a05bada0a656809f9011fc86a1e22a5 (patch) | |
tree | 12cd337e06876c26f5b156051ff01258e3bd6287 /src/llc.h | |
parent | 58db60c68ebf137ae2a886ec3bd1188431c84721 (diff) |
types: Add a simple testcase for basic types and fix the LLC code
* Make append_data, remaining_space and fits_in_current.. work
on m_length and not the index. This ways things can't overflow.
* The current API consumer was moving the m_index so it should have
worked okay.
Diffstat (limited to 'src/llc.h')
-rw-r--r-- | src/llc.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -63,7 +63,7 @@ inline uint16_t gprs_llc::chunk_size() const inline uint16_t gprs_llc::remaining_space() const { - return LLC_MAX_LEN - m_index; + return LLC_MAX_LEN - m_length; } inline uint16_t gprs_llc::frame_length() const @@ -85,5 +85,5 @@ inline void gprs_llc::consume(uint8_t *data, size_t len) inline bool gprs_llc::fits_in_current_frame(uint8_t chunk_size) const { - return m_index + chunk_size <= LLC_MAX_LEN; + return m_length + chunk_size <= LLC_MAX_LEN; } |