summaryrefslogtreecommitdiff
path: root/extmod/vfs_posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/vfs_posix.c')
-rw-r--r--extmod/vfs_posix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/vfs_posix.c b/extmod/vfs_posix.c
index ed4c06e36..bd9a6d840 100644
--- a/extmod/vfs_posix.c
+++ b/extmod/vfs_posix.c
@@ -194,7 +194,7 @@ static mp_obj_t vfs_posix_getcwd(mp_obj_t self_in) {
}
#endif
}
- return mp_obj_new_str(ret, strlen(ret));
+ return mp_obj_new_str_from_cstr(ret);
}
static MP_DEFINE_CONST_FUN_OBJ_1(vfs_posix_getcwd_obj, vfs_posix_getcwd);
@@ -234,7 +234,7 @@ static mp_obj_t vfs_posix_ilistdir_it_iternext(mp_obj_t self_in) {
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(3, NULL));
if (self->is_str) {
- t->items[0] = mp_obj_new_str(fn, strlen(fn));
+ t->items[0] = mp_obj_new_str_from_cstr(fn);
} else {
t->items[0] = mp_obj_new_bytes((const byte *)fn, strlen(fn));
}