X-Git-Url: https://git.jsancho.org/?p=guile-irrlicht.git;a=blobdiff_plain;f=src%2Fvertex3d.cpp;h=f7c7afb67e59e19b6d258417560d6e9c144b508b;hp=b7b57e2c70ef52bdf2a360566861117150ab36c2;hb=357f279e004c6257a160205835c06c283d317ef7;hpb=384a8fb56d8500dc3551085191a39c9da70e221c diff --git a/src/vertex3d.cpp b/src/vertex3d.cpp index b7b57e2..f7c7afb 100644 --- a/src/vertex3d.cpp +++ b/src/vertex3d.cpp @@ -60,22 +60,27 @@ init_vertex3d (void) video::E_VERTEX_TYPE scm_to_vertex_type (SCM vertex_type) { - char* type = scm_to_utf8_string (scm_symbol_to_string (vertex_type)); - if (!strcmp (type, "standard")) + char* type_name = scm_to_utf8_string (scm_symbol_to_string (vertex_type)); + video::E_VERTEX_TYPE type; + + if (!strcmp (type_name, "standard")) { - return video::EVT_STANDARD; + type = video::EVT_STANDARD; } - else if (!strcmp (type, "2tcoords")) + else if (!strcmp (type_name, "2tcoords")) { - return video::EVT_2TCOORDS; + type = video::EVT_2TCOORDS; } - else if (!strcmp (type, "tangents")) + else if (!strcmp (type_name, "tangents")) { - return video::EVT_TANGENTS; + type = video::EVT_TANGENTS; } else { scm_error (scm_arg_type_key, NULL, "Wrong vertex_type: ~S", scm_list_1 (vertex_type), scm_list_1 (vertex_type)); } + + free (type_name); + return type; }