diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-08-28 16:09:18 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-08-28 16:09:18 -0400 |
| commit | a72bcab0fd2af3c2b92f4d256c6bd5ae58fd225e (patch) | |
| tree | 745a219e936af91dac0a4d5de2cc0ef5d6c93a6b /lib | |
| parent | 0364f1dc854ff5f30b9ab2a72a406aab684a1d20 (diff) | |
| parent | 7cbae3d20c0f79511a932bbcb2d66d2620b6bb3a (diff) | |
Merge remote-tracking branch 'adafruit/master' into bleio-api-revamp
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils/buffer_helper.c | 4 | ||||
| -rw-r--r-- | lib/utils/buffer_helper.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/utils/buffer_helper.c b/lib/utils/buffer_helper.c index f6eb8bf1e..694952e3d 100644 --- a/lib/utils/buffer_helper.c +++ b/lib/utils/buffer_helper.c @@ -26,10 +26,10 @@ #include "lib/utils/buffer_helper.h" -void normalize_buffer_bounds(int32_t* start, int32_t end, uint32_t* length) { +void normalize_buffer_bounds(int32_t* start, int32_t end, size_t* length) { if (end < 0) { end += *length; - } else if (((uint32_t) end) > *length) { + } else if (((size_t) end) > *length) { end = *length; } if (*start < 0) { diff --git a/lib/utils/buffer_helper.h b/lib/utils/buffer_helper.h index 47042e7ef..7487b9df5 100644 --- a/lib/utils/buffer_helper.h +++ b/lib/utils/buffer_helper.h @@ -28,7 +28,8 @@ #define MICROPY_INCLUDED_LIB_UTILS_BUFFER_HELPER_H #include <stdint.h> +#include <string.h> -void normalize_buffer_bounds(int32_t* start, int32_t end, uint32_t* length); +void normalize_buffer_bounds(int32_t* start, int32_t end, size_t* length); #endif // MICROPY_INCLUDED_LIB_UTILS_BUFFER_HELPER_H |
