summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-09-04 00:12:09 -0400
committerDan Halbert <halbert@halwitz.org>2019-09-04 00:12:09 -0400
commit95a5a57f949c2f00caa144d246ce2a5477fb7c6d (patch)
treeab13631e2ed8dd1c74d257930d54b88d40178461 /lib
parentd3cb1030c8c8ab1395c17db1ec003e062c6a42a9 (diff)
parent321835cb4764e40d290635ba16a849aad6463f8d (diff)
Merge remote-tracking branch 'adafruit/master' into choose-usb-devices-xac
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/buffer_helper.c4
-rw-r--r--lib/utils/buffer_helper.h3
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