summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/obj.c2
-rw-r--r--py/obj.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/py/obj.c b/py/obj.c
index ae20db4354..04716454d7 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -410,7 +410,7 @@ bool mp_get_buffer(mp_obj_t obj, mp_buffer_info_t *bufinfo, int flags) {
return false;
}
int ret = type->buffer_p.get_buffer(obj, bufinfo, flags);
- if (ret != 0 || bufinfo->buf == NULL) {
+ if (ret != 0) {
return false;
}
return true;
diff --git a/py/obj.h b/py/obj.h
index fa42428fad..928402d44a 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -210,7 +210,7 @@ typedef struct _mp_buffer_info_t {
// them with ver = sizeof(struct). Cons: overkill for *micro*?
//int ver; // ?
- void *buf;
+ void *buf; // can be NULL if len == 0
mp_int_t len; // in bytes
int typecode; // as per binary.h