From f14fae10707bc20493dda7f5138af45c0eaabfa8 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 20 Mar 2022 20:50:07 +0100 Subject: [PATCH] Berry fix wrong type check --- lib/libesp32/berry_mapping/src/be_class_wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libesp32/berry_mapping/src/be_class_wrapper.c b/lib/libesp32/berry_mapping/src/be_class_wrapper.c index f6951a585..35195b6e6 100644 --- a/lib/libesp32/berry_mapping/src/be_class_wrapper.c +++ b/lib/libesp32/berry_mapping/src/be_class_wrapper.c @@ -216,7 +216,7 @@ intptr_t be_convert_single_elt(bvm *vm, int idx, const char * arg_type, int *buf if (provided_type) { bbool type_ok = bfalse; type_ok = (arg_type[0] == '.'); // any type is accepted - type_ok = type_ok || (arg_type[0] == provided_type); // or type is a match + type_ok = type_ok || (arg_type[0] == provided_type && arg_type[1] == 0); // or type is a match (single char only) type_ok = type_ok || (ret == 0 && arg_type_len != 1); // or NULL is accepted for an instance if (!type_ok) {