modffi: 's' (string) return type: handle NULL properly (return None).
This commit is contained in:
parent
32444b759a
commit
31c1f1300e
@ -140,6 +140,9 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type)
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 's': {
|
case 's': {
|
||||||
const char *s = (const char *)val;
|
const char *s = (const char *)val;
|
||||||
|
if (!s) {
|
||||||
|
return mp_const_none;
|
||||||
|
}
|
||||||
return mp_obj_new_str(s, strlen(s), false);
|
return mp_obj_new_str(s, strlen(s), false);
|
||||||
}
|
}
|
||||||
case 'v':
|
case 'v':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user