Skip to content
Snippets Groups Projects
Commit 31c1f130 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

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

parent 32444b75
No related branches found
No related tags found
No related merge requests found
......@@ -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':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment