Commit 31c1f130 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

modffi: 's' (string) return type: handle NULL properly (return None).

parent 32444b75
......@@ -140,6 +140,9 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type)
switch (type) {
case 's': {
const char *s = (const char *)val;
if (!s) {
return mp_const_none;
return mp_obj_new_str(s, strlen(s), false);
case 'v':
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment