Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf73b6a

Browse files
committed
fixup! Correct Python to Godot string conversion by using gd_string_name_from_utf8_and_len to avoid relying on null terminated C string
1 parent 01fde3e commit cf73b6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/godot/hazmat/extension_class.pxd

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ cdef inline void register_extension_class_creation(
7979
# Don't increment refcount given we rely on gc protector
8080
info.class_userdata = <void*>spec # void*
8181

82-
cdef gd_string_name_t gdname = gd_string_name_from_utf8_and_len(<char*>class_name, class_name.len())
83-
cdef gd_string_name_t gdname_parent = gd_string_name_from_utf8_and_len(<char*>parent_class_name, parent_class_name.len())
82+
cdef gd_string_name_t gdname = gd_string_name_from_utf8_and_len(<char*>class_name, len(class_name))
83+
cdef gd_string_name_t gdname_parent = gd_string_name_from_utf8_and_len(<char*>parent_class_name, len(parent_class_name))
8484
# TODO: correct me once https://github.com/godotengine/godot/pull/67121 is merged
8585
pythonscript_gdextension.classdb_register_extension_class(
8686
pythonscript_gdextension_library,

0 commit comments

Comments
 (0)